-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathabtstart
More file actions
44 lines (36 loc) · 1.49 KB
/
abtstart
File metadata and controls
44 lines (36 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/python
import os, sys, signal
from time import sleep
from subprocess import Popen, PIPE
import abtserver.rpc_main
if __name__ == "__main__":
try:
if os.path.exists("/opt/abt") == False: # check for abt directory , if false then
try:
print "creating abt and db directory and copying places.db to abt"
os.system("mkdir -p /opt/abt/db") # create abt directory and db to host all databases
os.system("mkdir -p /opt/abt/export")
if os.path.exists("./src/places.db") == True:
os.system("cp ./src/places.db /opt/abt/places.db") # copy places.db from /src to abt
else:
os.system("cp root/ABTcore/src/places.db /opt/abt/places.db") # copy places.db from /src to abt
except:
print "can't create directory somthing is wrong"
else:
if os.path.exists("/opt/abt/db") == False: # check for abt/db directory , if false then
try:
print "creating db directory and copying places.db"
os.system("mkdir /opt/abt/db") # create db directory in abt
os.system("mkdir -p /opt/abt/export")
if os.path.exists("./src/places.db") == True:
os.system("cp ./src/places.db /opt/abt/places.db") # copy places.db from /src to abt
else:
os.system("cp root/ABTcore/src/places.db /opt/abt/places.db") # copy places.db from /src to abt
except:
print "can't create directory somthing is wrong"
else:
print "db already exist"
print "abt already exist"
abtserver.rpc_main.runabt()
except:
print "inside exception"