|
|
@ -104,19 +104,23 @@ if os.getuid() == 0:
|
|
|
|
if os.path.isdir("/home/pylsa/.pylsa"):
|
|
|
|
if os.path.isdir("/home/pylsa/.pylsa"):
|
|
|
|
# Already installed, run as pylsa user
|
|
|
|
# Already installed, run as pylsa user
|
|
|
|
switch_user()
|
|
|
|
switch_user()
|
|
|
|
|
|
|
|
os.chdir("/home/pylsa/.pylsa")
|
|
|
|
exit(subprocess.call(["python", "/home/pylsa/.pylsa/daemon.py"]))
|
|
|
|
exit(subprocess.call(["python", "/home/pylsa/.pylsa/daemon.py"]))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# Not installed yet, install as pylsa user then run
|
|
|
|
# Not installed yet, install as pylsa user then run
|
|
|
|
add_user("pylsa")
|
|
|
|
add_user("pylsa")
|
|
|
|
install(True)
|
|
|
|
install(True)
|
|
|
|
switch_user()
|
|
|
|
switch_user()
|
|
|
|
|
|
|
|
os.chdir("/home/pylsa/.pylsa")
|
|
|
|
exit(subprocess.call(["python", "/home/pylsa/.pylsa/daemon.py"]))
|
|
|
|
exit(subprocess.call(["python", "/home/pylsa/.pylsa/daemon.py"]))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# Script is run as unprivileged user
|
|
|
|
# Script is run as unprivileged user
|
|
|
|
if os.path.isdir(os.path.expanduser("~/.pylsa")):
|
|
|
|
if os.path.isdir(os.path.expanduser("~/.pylsa")):
|
|
|
|
# Already installed
|
|
|
|
# Already installed
|
|
|
|
|
|
|
|
os.chdir(os.path.expanduser("~/.pylsa"))
|
|
|
|
exit(subprocess.call(["python", os.path.expanduser("~/.pylsa/daemon.py")]))
|
|
|
|
exit(subprocess.call(["python", os.path.expanduser("~/.pylsa/daemon.py")]))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# Not installed yet
|
|
|
|
# Not installed yet
|
|
|
|
install(False)
|
|
|
|
install(False)
|
|
|
|
|
|
|
|
os.chdir(os.path.expanduser("~/.pylsa"))
|
|
|
|
exit(subprocess.call(["python", os.path.expanduser("~/.pylsa/daemon.py")]))
|
|
|
|
exit(subprocess.call(["python", os.path.expanduser("~/.pylsa/daemon.py")]))
|
|
|
|