-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaster.sh
35 lines (31 loc) · 796 Bytes
/
master.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
#!/bin/bash
################################################################################
# Sometimes the port number causes problem and it doesn't restart
while true
do
echo "s to start, q to exit, r to start/ restart."
read key
if [[ "$key" == 'r' ]]
then
echo "Server Running On port 5562"
echo
kill $(lsof -t -i:5562)
gnome-terminal -e "bash -c \"python3 httpServer.py 5562; exec bash\""
elif [[ "$key" == 'q' ]]
then
echo "Shutting Down... zzzz..."
# program to quit
# fuser -k 5562/tcp
kill $(lsof -t -i:5562)
# killall terminal
exit;
elif [[ $key == 's' ]]
then
echo "Starting :D"
# killall zsh
kill $(lsof -t -i:5562)
gnome-terminal -e "bash -c \"python3 httpServer.py 5562; exec bash\""
else
echo
fi
done