-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkodinggui.py
107 lines (84 loc) · 2.44 KB
/
kodinggui.py
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/python
import os
import getpass
import sys
def redraw():
os.system(['clear','cls'][os.name == 'nt'])
print """\
** ** ** **
/** /**// ***** ***** //
/** ** ****** /** ** ******* **///** **///** ** ** **
/** ** **////** ******/**//**///**/** /** /** /**/** /**/**
/**** /** /** **///**/** /** /**//****** //******/** /**/**
/**/** /** /**/** /**/** /** /** /////** /////**/** /**/**
/**//**//****** //******/** *** /** ***** ***** //******/**
// // ////// ////// // /// // ///// ///// ////// // Version 1.1
"""
redraw()
def mainmenu():
print """\
(1) Services
(2) Setup FTP
(3) Setup Webmin
(^C) Quit
"""
def services():
print """\
(1) Start
(2) Stop
(3) Restart
(4) Main menu
"""
x = 0
while x is not "q" or x is not "Q":
try:
redraw()
mainmenu()
x = raw_input("Choose an Option. ")
if int(x) == 1:
redraw()
print """\
(1) Apache
(2) FTP
(3) Webmin
"""
b = raw_input("Choose an Option. ")
if int(b) == 1:
services()
a = int(raw_input("Choose an option. "))
if a == 1:
os.system("sudo service apache2 start")
elif a == 2:
os.system("sudo service apache2 stop")
elif a == 3:
os.system("sudo service apache2 restart")
elif int(b) == 2:
services()
a = int(raw_input("Choose an option. "))
if a == 1:
os.system("sudo service proftpd start")
elif a == 2:
os.system("sudo service proftpd stop")
elif a == 3:
os.system("sudo service proftpd restart")
elif int(b) == 3:
services()
a = int(raw_input("Choose an option. "))
if a == 1:
os.system("sudo service webmin start")
elif a == 2:
os.system("sudo service webmin stop")
elif a == 3:
os.system("sudo service webmin restart")
elif int(x) == 2:
os.system("sudo apt-get install proftpd")
os.system("sudo passwd " + str(getpass.getuser()))
elif int(x) == 3:
os.system("wget http://prdownloads.sourceforge.net/webadmin/webmin_1.710_all.deb")
os.system("sudo dpkg -i webmin_1.710_all.deb")
os.system("sudo apt-get -f install")
os.system("sudo dpkg -i webmin_1.710_all.deb")
os.system("rm webmin_1.710_all.deb")
except KeyboardInterrupt:
print
sys.exit()