Skip to content

Commit

Permalink
Add initial start wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
alebcay committed Jul 22, 2014
1 parent 7268abf commit 3f405b1
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions pushblast
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,31 @@ fi
chmod +x ~/.config/pushblast/lib/pushbullet

if [ ! -e ~/.config/pushblast/pushblastrc ] ; then
echo "Config file at ~/.config/pushblast/pushblastrc is missing."
echo "See README.md for info on what to put there."
exit 1
touch ~/.config/pushblast/pushblastrc
echo "Welcome to PushBlast! Before I get started, I'll need a few things from you regarding your PushBullet account."
echo -e "\nPlease provide your PushBullet API key, also known as an access token. I need this to be able to push stuff: "
read API_KEY
echo -e "\nPlease provide the device name you wish to push to. Device names are case sensitive, so be careful: "
read DEV_NAME
echo -e "\nPlease name this computer. Computer names are shown on the notification so you know where a notification came from."
read COMP_NAME
echo "API_KEY=\"$API_KEY\"" >> ~/.config/pushblast/pushblastrc
echo "DEV_NAME=\"$DEV_NAME\"" >> ~/.config/pushblast/pushblastrc
echo "COMP_NAME=\"$COMP_NAME\"" >> ~/.config/pushblast/pushblastrc
echo -e "\nLooks like we're all good to go. I'll go ahead and run the command you gave."
fi

source ~/.config/pushblast/pushblastrc

if [ $API_KEY = "" ] ; then
if [[ $API_KEY = "" ]] ; then
echo "Invalid API key. Find your access token at https://www.pushbullet.com/account."
exit 1
fi

touch ~/.config/pushbullet
echo "API_KEY=$API_KEY" > ~/.config/pushbullet

if [ $DEV_NAME = "" ] ; then
if [[ $DEV_NAME = "" ]] ; then
echo "Invalid target device name. Find your list of devices at https://www.pushbullet.com."
exit 1
fi
Expand Down

0 comments on commit 3f405b1

Please sign in to comment.