-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinux_addon
More file actions
48 lines (43 loc) · 1.1 KB
/
Copy pathlinux_addon
File metadata and controls
48 lines (43 loc) · 1.1 KB
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
#!/bin/bash
NAME=rust_addon_server_n1
DIR=/home/rust/addon/
# -------------------------------------------------------------------
case "$1" in
start)
echo "Error: Start command has been removed, use %0 restart"
;;
stop)
if [[ `screen -ls |grep $NAME` ]]
then
kill `screen -ls |grep $NAME |awk -F . '{print $1}'|awk '{print $1}'`
echo "$NAME was stopped"
else
echo "Error: $NAME isn't currently running"
fi
;;
status)
if [[ `screen -ls |grep $NAME` ]]
then
echo "$NAME is currently running"
else
echo "$NAME is NOT running"
fi
;;
restart)
if [[ `screen -ls |grep $NAME` ]]
then
kill `screen -ls |grep $NAME |awk -F . '{print $1}'|awk '{print $1}'`
echo "$NAME was stopped"
else
echo "Error: $NAME isn't currently running"
fi
cd $DIR
screen -S $NAME -d -m bash -c "php main.php"
echo "$NAME was started."
;;
*)
echo "Usage: $0 {stop|status|restart}"
exit 1
;;
esac
exit 0