forked from StewAlexander-com/Linux-Tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinux-Software-Installed.py
95 lines (89 loc) · 2.67 KB
/
Linux-Software-Installed.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
#!/usr/bin/env python3
import os
import sys
import uuid
from shutil import which
#Print checking if these programs are installed or not
print("""\nChecking if these programs are installed or not:\n
>> chkservice
>> htop
>> nnn
>> ncdu
>> network-manager
>> ne
>> hping3
>> nmap
>> lynis
>> apt-show-versions
>> vim
>> fish
>> tig
>> bmon
>> dnsutils
>> most\n""")
#Check if these programs exist [chkservice,htop,nnn,ncdu,network-manager,ne,hping3,nmap,lynis,apt-show-versions,vim,fish,tig,bmon,dnsutils,most], if not install them
def check_programs():
programs = ['chkservice','htop','nnn','ncdu','network-manager','ne','hping3','nmap','lynis','apt-show-versions','vim','fish','tig','bmon','dnsutils','most']
for program in programs:
if which(program) is None:
print("\n>> \"" + program + '\" is not installed')
install_program(program)
else:
print("- \"" + program + '\" is installed')
#Install programs
def install_program(program):
if program == 'chkservice':
os.system('sudo apt-get install chkservice')
print("\n")
elif program == 'htop':
os.system('sudo apt-get install htop')
print("\n")
elif program == 'nnn':
os.system('sudo apt-get install nnn')
print("\n")
elif program == 'ncdu':
os.system('sudo apt-get install ncdu')
print("\n")
elif program == 'network-manager':
os.system('sudo apt-get install network-manager')
print("\n")
elif program == 'ne':
os.system('sudo apt-get install ne')
print("\n")
elif program == 'hping3':
os.system('sudo apt-get install hping3')
print("\n")
elif program == 'nmap':
os.system('sudo apt-get install nmap')
print("\n")
elif program == 'lynis':
os.system('sudo apt-get install lynis')
print("\n")
elif program == 'apt-show-versions':
os.system('sudo apt-get install apt-show-versions')
print("\n")
elif program == 'vim':
os.system('sudo apt-get install vim')
print("\n")
elif program == 'fish':
os.system('sudo apt-get install fish')
print("\n")
elif program == 'tig':
os.system('sudo apt-get install tig')
print("\n")
elif program == 'bmon':
os.system('sudo apt-get install bmon')
print("\n")
elif program == 'dnsutils':
os.system('sudo apt-get install dnsutils')
print("\n")
elif program == 'most':
os.system('sudo apt-get install most')
print("\n")
else:
print('Program not found\n')
#run check_programs()
check_programs()
#Press reuturn to quit
input('\n\nPress return to quit')
sys.exit()