-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshellview.sh
executable file
·60 lines (59 loc) · 1.37 KB
/
shellview.sh
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
#!/bin/sh
# ShellView v0.4
_has_dialog=$(dpkg-query -W --showformat='${status}\n' dialog|grep "install ok installed")
_has-a2=$(dpkg-query -W --showformat='${status}\n' apache2|grep "install ok installed")
_has-f2b=$(dpkg-query -W --showformat='${Status}\n' fail2ban|grep "install ok installed")
if [ "$_has_dialog" != "" ]; then
dialog --backtitle "ShellView" \
--title "ShellView 0.4" \
--cancel-button exit \
--menu "Please select a view" 20 100 5 \
ssh "SSH" \
fail2ban "Fail2ban" \
apache2 "Apache2" \
system "System" \
about "About ShellView" \
2>temp
else
echo "dialog not installed. use 'apt-get install dialog' to install it."
fi
if [ "$?" = "0" ]
then
_return=$(cat temp)
if [ "$_return" = "ssh" ]
then
~/shellview/check/ssh/ssh.sh
fi
if [ "$_has-f2b" != "" ]
then
if [ "$_return" = "fail2ban" ]
then
~/shellview/check/fail2ban/fail2ban.sh
fi
else
dialog --backtitle "ShellView" \
--title "Error" \
--msgbox "fail2ban isnt installed" 15 150
fi
if [ "$_has-a2" != "" ]; then
if [ "$_return" = "apache2" ]
then
~/shellview/check/apache2/apache2.sh
fi
else
dialog --backtitle "ShellView" \
--title "Error" \
--msgbox "Apache2 isnt installed" 15 150
fi
if [ "$_return" = "system" ]
then
~/shellview/tools/system.sh
fi
if [ "$_return" = "about" ]
then
~/shellview/tools/about.sh
fi
fi
rm -f temp
clear
echo "ShellView exited"