mirror of
https://github.com/OpenSolo/OpenSolo.git
synced 2025-04-30 22:54:37 +02:00
don't run onre than 1 of these at a time.wq
This commit is contained in:
parent
4d97c620b8
commit
4b76c7a450
@ -5,6 +5,7 @@ import time
|
|||||||
import pwd
|
import pwd
|
||||||
import subprocess
|
import subprocess
|
||||||
import os, pwd, grp
|
import os, pwd, grp
|
||||||
|
import os.path
|
||||||
|
|
||||||
def get_username():
|
def get_username():
|
||||||
return pwd.getpwuid( os.getuid() )[ 0 ]
|
return pwd.getpwuid( os.getuid() )[ 0 ]
|
||||||
@ -14,6 +15,10 @@ if ( me != 'root' ) :
|
|||||||
print(" must be run as root, sorry, aborting. \n");
|
print(" must be run as root, sorry, aborting. \n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
|
if os.path.isfile("/vagrant/progress.log"):
|
||||||
|
print "unable to run, another copy is already runniing, see /vagrant/progress.log";
|
||||||
|
exit(1);
|
||||||
|
|
||||||
# open logfile:
|
# open logfile:
|
||||||
logfile = "/vagrant/progress.log"
|
logfile = "/vagrant/progress.log"
|
||||||
log = open(logfile, "w+")
|
log = open(logfile, "w+")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user