-
Notifications
You must be signed in to change notification settings - Fork 0
/
myweb.sh
executable file
·139 lines (129 loc) · 2.88 KB
/
myweb.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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash
# TITLE: Apache2Control
# AUTHOR: RJ Levesque, Jr. - Majik Cat Security
# DATE: July 21, 2019
# GITHUB: https://github.com/hwac121
#=================================
# FUNCTIONS
#=================================
Splash(){
echo -e "\e[33m ____ ____ ____ __ __ __ ___\e[0m";
sleep 0.05
echo -e "\e[33m / | \ / | / ] | | / _]\e[0m";
sleep 0.05
echo -e "\e[33m| o | o ) o | / /| | |/ [_\e[0m";
sleep 0.05
echo -e "\e[33m| | _/| |/ / | _ | _]\e[0m";
sleep 0.05
echo -e "\e[33m| _ | | | _ / \_| | | [_\e[0m";
sleep 0.05
echo -e "\e[33m| | | | | | \ | | | |\e[0m";
sleep 0.05
echo -e "\e[33m|__|__|__|_ |__|__|\____|__|__|_____| _\e[0m";
sleep 0.05
echo -e "\e[33m / ]/ \| \| | \ / \| |\e[0m";
sleep 0.05
echo -e "\e[33m / /| | _ | | D ) | |\e[0m";
sleep 0.05
echo -e "\e[33m / / | O | | |_| |_| /| O | |___\e[0m";
sleep 0.05
echo -e "\e[33m/ \_| | | | | | | \| | |\e[0m";
sleep 0.05
echo -e "\e[33m\ | | | | | | | . \ | |\e[0m";
sleep 0.05
echo -e "\e[33m \____|\___/|__|__| |__| |__|\_|\___/|_____|\e[0m";
sleep 0.05
echo " "
}
#=================================
# CHECK FOR ROOT
#=================================
if [ "$EUID" -ne 0 ]
then echo -e "You must run as root or sudo myweb";
exit
fi
#=================================
# MAIN MENU
#=================================
options=("Start Apache2" "Restart Apache2" "Stop Apache2" "Check Status" "Check Port 80" "Kill Process" "Check Errors" "Quit")
PS3='Choose option for Apache2: '
while [ "$menu" != 1 ]; do
clear
Splash
select opt in "${options[@]}" ; do
case $opt in
"Start Apache2")
service apache2 start
sleep 2
clear
Splash
break
;;
"Restart Apache2")
service apache2 restart
sleep 2
clear
Splash
break
;;
"Stop Apache2")
service apache2 stop
sleep 2
clear
Splash
break
;;
"Check Status")
echo -e "\e[33mUse q to close results\e[0m";
service apache2 status
clear
Splash
break
;;
"Check Port 80")
clear
Splash
netstat -tulpn | grep :80
sleep 4
break
;;
"Kill Process")
echo -e "Enter PID to kill"
read kpid
kill $kpid
clear
Splash
break
;;
"Check Errors")
echo -e "Use q to close results";
journalctl -xe
clear
Splash
break
;;
"Quit")
clear
Splash
echo -e " "
echo -e "\e[37mThank you for using Apache2 Manager by Majik Cat Security\e[0m";
sleep 3
clear
menu=1
break
;;
#============================================================================================$
#======== ERROR CAPTURE - INVALID OPTION ====$
#============================================================================================$
*)
clear
Splash
echo -e "invalid option $REPLY";
Clear
Splash
break
;;
esac
done
done
exit 0