-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhost.py
More file actions
112 lines (87 loc) · 2.06 KB
/
host.py
File metadata and controls
112 lines (87 loc) · 2.06 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
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
108
109
110
111
112
import user
import utilities
import file
import os
import subprocess
#Blank Comment
def local():
print("""
Press 1: to check date
Press 2: to check cal
Press 3: to check ls
Press 4: to create user
Press 5: to remove user
Press 6: to create file
Press 7: to delete file
Press 8: exit
""")
print ("Enter your choice:", end=' ')
ch = input()
if int(ch) == 1:
utilities.date()
elif int(ch) == 2:
utilities.cal()
elif int(ch) == 3:
utilities.list()
elif int(ch) == 4:
user.addUser()
elif int(ch) == 5:
user.removeUser()
elif int(ch) == 6:
file.createFile()
elif int(ch) == 7:
file.deleteFile()
elif int(ch) == 8:
os.system('tput setaf 6')
print ("\n***Thank You***\n")
os.system('tput setaf 7')
exit()
else:
os.system('tput setaf 1')
print ("Invalid Key. Retry")
os.system('tput setaf 7')
print("Press Any Key To Continue...")
input()
def remote():
print("Enter remotehost IP: ", end=' ')
remotehost=input()
print("""
Press 1: to check date
Press 2: to check cal
Press 3: to check ls
Press 4: to create user
Press 5: to remove user
Press 6: to create file
Press 7: to delete file
Press 8: Ping {} to check connectivity.
Press 9: exit
""".format(remotehost))
print ("enter your choice:", end=' ')
ch = input()
if int(ch) == 1:
utilities.remoteDate(remotehost)
elif int(ch) == 2:
utilities.remoteCal(remotehost)
elif int(ch) == 3:
utilities.remoteList(remotehost)
elif int(ch) == 4:
user.addRemoteUser(remotehost)
elif int(ch) == 5:
user.removeRemoteUser(remotehost)
elif int(ch) == 6:
file.createRemoteFile(remotehost)
elif int(ch) == 7:
file.removeRemoteFile(remotehost)
elif int(ch) == 8:
os.system("ping {}".format(remotehost))
elif int(ch) == 9:
os.system('tput setaf 6')
print ("\n***Thank You***\n")
os.system('tput setaf 7')
exit()
else:
os.system('tput setaf 1')
print ("Invalid Key. Retry")
os.system('tput setaf 7')
print("Press Any Key To Continue...")
input()