--- /home/andrew/Github/AlexaPi/setup.sh	2017-02-14 13:01:33.083942183 -0800
+++ /home/andrew/Github/AlexaPi2/setup.sh	2017-02-16 17:30:17.238995532 -0800
@@ -1,36 +1,44 @@
-#! /bin/bash
-
-apt-get update
-apt-get install libasound2-dev memcached mpg123 python-alsaaudio -y
-easy_install pip
-pip install -r requirements.txt
-cp initd_alexa.sh /etc/init.d/AlexaPi
-update-rc.d AlexaPi defaults
-touch /var/log/alexa.log
-
-echo "Enter your Device Type ID :"
-read productid
-echo ProductID = \"$productid\" >> creds.py
-
-echo "Enter your Security Profile Description:"
-read spd
-echo Security_Profile_Description = \"$spd\" >> creds.py
-
-echo "Enter your Security Profile ID:"
-read spid
-echo Security_Profile_ID = \"$spid\" >> creds.py
-
-echo "Enter your Security Client ID:"
-read cid
-echo Client_ID = \"$cid\" >> creds.py
-
-echo "Enter your Security Client Secret:"
-read secret
-echo Client_Secret = \"$secret\" >> creds.py
-
-ip=`hostname -I`
-python ./auth_web.py 
-echo "Open http://$ip:5000"
-
-echo "You can now reboot"
+#! /bin/sh
 
+if [ $# -eq 0 ] ; then
+	$1 = "none";
+fi
+
+if [ ! -f creds.py ] || [ $1 = "auto" ] ; then
+	echo "" > creds.py
+	if [ -f alexaToken.py ] ; then
+		rm alexaToken.py 2>&1
+	fi
+
+	printf "Visit https://developer.amazon.com/ to find the following information.\nMore detailed instructions can be found here:https://ntc.githost.io/nextthingco/chiptainer_alexa/blob/master/README.md\n" 
+	echo "Enter your Device Type ID :"
+	read productid
+	echo ProductID = \"$productid\" >> creds.py
+
+	echo "Enter your Security Profile Description:"
+	read spd
+	echo Security_Profile_Description = \"$spd\" >> creds.py
+
+	echo "Enter your Security Profile ID:"
+	read spid
+	echo Security_Profile_ID = \"$spid\" >> creds.py
+
+	echo "Enter your Security Client ID:"
+	read cid
+	echo Client_ID = \"$cid\" >> creds.py
+
+	echo "Enter your Security Client Secret:"
+	read secret
+	echo Client_Secret = \"$secret\" >> creds.py
+
+	printf "\nStarting web server..."
+
+	python ./auth_web.py &
+
+	while [ ! -f alexaToken.py ];
+	do
+    		sleep 1;
+	done;
+fi
+echo "Starting Alexa..."
+python main.py
