import os


print("Example Pi Box path: /home/username/my-pi-box")
pi_box_directory = raw_input("Pi Box path: ")

if not os.path.isdir(pi_box_directory):
	os.makedirs(pi_box_directory)

with open('./install/pi-box-conf-template.txt', 'r') as f:
	upstart_template = f.read()

with open('/etc/init/pi-box.conf', 'w+') as f:
	f.write(upstart_template.format(pi_box_directory))

@@ -3,16 +3,324 @@
 port os%0A
+import sys%0A%0Aif not os.path.exists('/opt/Pi-Box/dropbox.txt'):%0A%09print('Dropbox token file (dropbox.txt) not found.')%0A%09print('Go here to authorize Pi-Box and obtain the token file: blah, blah, blah')%0A%09print('Save the file in: /opt/Pi-Box')%0A%09print('Run the installation script again: ./install.sh')%0A%09sys.exit()%0A
 %0A%0Aprint(

Check for token file before installing