-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtui.py
75 lines (52 loc) · 1.9 KB
/
tui.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
import os
os.system("tput setaf 1")
print("\t\t\t\t\tHERE IS MY TUI")
os.system("tput setaf 7")
print("""\t\t\tCONTROL THE WHOLE LINUX JUST BY TYPING DIGITS\n
\t\t\t\t\tBY ABHIJEET PATHAK""")
while True :
print("""Press 1 : For Adding user
press 2 : To update the whole system
press 3 : Making dir
press 4 : Connect to server/other system using ssh
press 5 : Make a file executable
press 6 : To configure web server
press 7 : Listing all the storage attached
press 8 : Troubleshoot Network Connectivity
press 9 : List all the hidden files in present directory
print 10 : Install particular package
print 11 : To exit""")
print("enter your choice")
ch=input()
if ch == "1" :
us = input("Name the user :")
os.system("sudo adduser {} " .format(us))
elif ch == "2" :
os.system("sudo apt-get update && upgarde")
elif ch == "3" :
print("Dir name : " , end = "" )
file_name= input()
os.system("mkdir {}".format(file_name))
elif ch == "4" :
x , y = input("enter the user and ip : " ).split()
os.system("ssh {}@{} " .format(x , y))
elif ch == "5" :
exe = input("Name the file : ")
os.system("chmod +x {} " .format(exe))
elif ch == "6" :
print("place your files and data in /var/www/ directory ")
os.system("service apache2 start")
elif ch == "7" :
os.system("sudo fdisk -l && lsblk ")
elif ch == "8" :
os.system("sudo service NetworkManager restart")
elif ch == "9" :
os.system("ls -al")
elif ch == "10" :
pack = input("name the package/software :")
os.system("sudo apt-get install {} " .format(pack))
elif ch == "11" :
print("Exiting...")
exit()
else :
print("Please enter a valid option")