changeset 463:ac568832a71a

fixed lauching script
author Goffi <goffi@goffi.org>
date Sat, 24 Mar 2012 16:11:16 +0100
parents d9456d94cd12
children 794f60e2da27
files src/sat.sh
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/sat.sh	Wed Mar 14 23:45:01 2012 +0100
+++ b/src/sat.sh	Sat Mar 24 16:11:16 2012 +0100
@@ -20,6 +20,7 @@
 eval `python<<PYTHONEND
 from ConfigParser import SafeConfigParser
 from os.path import expanduser, join
+import sys
 
 config = SafeConfigParser(defaults={'local_dir':'~/.sat',
 									'pid_dir':'/tmp',
@@ -27,12 +28,19 @@
 try:
 	config.read(map(expanduser, ['/etc/sat.conf', '~/sat.conf', '~/.sat.conf', 'sat.conf', '.sat.conf']))
 except:
-	print ("Can't read main config !")
-print "LOCAL_DIR='%s'" % join(expanduser(config.get('DEFAULT', 'local_dir')),'')
-print "PID_DIR='%s'" % join(expanduser(config.get('DEFAULT', 'pid_dir')),'')
-print "LOG_DIR='%s'" % join(expanduser(config.get('DEFAULT', 'pid_dir')),'')
+	print ("echo \"/!\\ Can't read main config ! Please check the syntax\";")
+	print ("exit 1")
+	sys.exit()
+
+env=[]
+env.append("LOCAL_DIR='%s'" % join(expanduser(config.get('DEFAULT', 'local_dir')),''))
+env.append("PID_DIR='%s'" % join(expanduser(config.get('DEFAULT', 'pid_dir')),''))
+env.append("LOG_DIR='%s'" % join(expanduser(config.get('DEFAULT', 'pid_dir')),''))
+
+print ";".join(env)
 PYTHONEND
 `
+
 PID_FILE="$PID_DIR$NAME.pid"
 LOG_FILE="$LOCAL_DIR$NAME.log"
 DAEMON="n"