fixed lauching script
This commit is contained in:
parent
07de449dc9
commit
65c5a4f908
1 changed files with 12 additions and 4 deletions
16
src/sat.sh
16
src/sat.sh
|
|
@ -20,6 +20,7 @@ NAME='sat'
|
|||
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 @@ config = SafeConfigParser(defaults={'local_dir':'~/.sat',
|
|||
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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue