-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathhiddenbackupd
More file actions
executable file
·38 lines (31 loc) · 1.01 KB
/
hiddenbackupd
File metadata and controls
executable file
·38 lines (31 loc) · 1.01 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
#!/usr/bin/python
import argparse
import sys
from HiddenBackup.Daemonize import Daemonize
from HiddenBackup.DisplayQR import DisplayQR
__application__ = "HDBackupd"
__version__ = "0.1.0"
__release__ = __application__ + '/' + __version__
__author__ = "Juan Ezquerro LLanes"
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--start', help='Start Server', action="store_true")
parser.add_argument('--stop', help='Stop Server', action="store_true")
parser.add_argument('--restart', help='Restart Server', action="store_true")
parser.add_argument('--qr', help='Display QR code for connect a client', action="store_true")
args = parser.parse_args()
# Sign the services
if args.qr:
qr = DisplayQR()
qr.display()
sys.exit(0)
# Daemon manager
daemon = Daemonize()
if args.start:
daemon.start()
elif args.stop:
daemon.stop()
elif args.restart:
daemon.restart()
else:
parser.print_help()