-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphy4.py
More file actions
70 lines (60 loc) · 2.04 KB
/
Copy pathphy4.py
File metadata and controls
70 lines (60 loc) · 2.04 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
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
import os
os.system("tput setaf 1")
print("t\t\thay welcome to TUI thats make life simple")
os.system("tput setaf 7")
print("\t\t\t---------------------------------------")
print("where you would like to perform your job (local/remote) :" , end='')
location = input()
print(location)
if location == "remote":
remoteIP = input("Enter ur IP : ")
while true:
print("""
press 1: to see date
press2: to check cal
press3: conf web server
press4: to create user
press5: create file
""")
print("Enter your choice : " , end="")
ch=input()
print(ch)
if location == "local":
if int(ch) == 1:
os.system("date")
elif int(ch) == 2:
os.system("cal")
elif int(ch) == 3:
os.system("yum install httpd")
elif int(ch) == 4:
print("can u plz user name: " , end='')
create user = input()
os.system("useradd {}".format (create_user))
elif int(ch) == 5:
os.system("date")
elif int(ch) == 6:
os.system("date")
elif int(ch) == 7:
exit()
else:
print("option not supported")
input("Enter to continue....")
os.system("clear")
elif location == "local":
if int(ch) == 1:
os.system("ssh {0} date".fotmate(remoteIP))
elif int(ch) == 2:
os.system("ssh {0} cal".fotmate(remoteIP))
elif int(ch) == 3:
os.system("yum install httpd")
elif int(ch) == 4:
print("can u plz user name: " , end='')
create user = input()
os.system("useradd {}".format (create_user))
elif int(ch) == 5:
os.system("date")
elif int(ch) == 6:
os.system("date"
)
else:
print("option not supported")