You are not logged in.
Pages: 1
The first time a user runs this it prompts for their Skype username and password. Initially I sought to store that user input ($skypeuser and $skypepass) in SKYPEUSR and SKYPEPWD so the user only has to enter his credentials once. But I am not sure how to do this. According to the post linked below I should store the input in a file on the user's disk, then have the script read it. What other options are available? Thank you!
http://askubuntu.com/questions/52212/wh … y-a-script
#!/usr/bin/env bash
SKYPEUSR=()
SKYPEPWD=()
skypeLoginAuth() {
if [[ -z ${SKYPEUSR} && -z ${SKYPEPWD} ]]; then
echo -e "\nSkype name and password are unset.\nType your Skype username and hit Enter"
read -p $'\e[1;36m>>> ' skypeuser
echo -e "\nType your Skype password and hit Enter"
read -p $'\e[1;36m>>> ' skypepass
skypeLogin
else
skypeLogin
fi
}
skypeLogin() {
echo -e "\nLaunching Skype...\n"
echo $skypeuser $skypepass | nohup skype --pipelogin >/dev/null 2>&1 &
}
Offline
What other option do you need? Do you have anything specific in mind?
Offline
Do these data need to be secured/encrypted or can they be stored in plain text? If plain text will work, just write them to a file, then instead of echoing the variables to the skype pipe, just redirect input from the file:
skype --whatever flags < ~/.skype_credentials
If you want to avoid any extra file and plain-text is still safe, you can have a self modifying script:
skype_user=""
skype_pass=""
if [[ $skype_user == "" ]]; then
read -p "user name: " skype_user
sed -i 's/^skype_user=""/skype_user="'$skype_user'"/' $0
fi
if [[ $skype_pass == "" ]]; then
read -p "password: " skype_pass
sed -i 's/^skype_pass=""/skype_pass="'$skype_pass'"/' $0
fi
echo $skype_user $skype_pass | nohup ...
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Pages: 1