2019-07-13 23:23:04 +08:00
|
|
|
#!/bin/sh /etc/rc.common
|
2020-02-29 04:53:43 +08:00
|
|
|
|
2019-07-13 23:23:04 +08:00
|
|
|
START=99
|
|
|
|
|
STOP=10
|
|
|
|
|
|
2020-03-19 00:40:00 +08:00
|
|
|
start() {
|
2020-04-19 20:03:12 +08:00
|
|
|
state=`pgrep -f "/usr/bin/serverchan/serverchan"`
|
|
|
|
|
if [ ! -z "$state" ]; then
|
|
|
|
|
restart
|
|
|
|
|
else
|
|
|
|
|
/usr/bin/serverchan/serverchan &
|
|
|
|
|
fi
|
2020-03-05 19:05:08 +08:00
|
|
|
echo "serverchan is starting now ..."
|
2019-07-13 23:23:04 +08:00
|
|
|
}
|
2020-02-28 18:36:47 +08:00
|
|
|
|
2019-07-13 23:23:04 +08:00
|
|
|
stop() {
|
2020-03-05 19:05:08 +08:00
|
|
|
kill -9 `pgrep -f "/usr/bin/serverchan/serverchan"` 2>/dev/null
|
2020-03-03 15:30:34 +08:00
|
|
|
echo "serverchan exit ..."
|
2019-12-14 17:35:25 +08:00
|
|
|
}
|
2020-02-28 18:36:47 +08:00
|
|
|
|
|
|
|
|
restart(){
|
2020-04-19 20:03:12 +08:00
|
|
|
stop
|
2020-04-23 03:08:32 +08:00
|
|
|
sleep 1
|
2020-02-28 18:36:47 +08:00
|
|
|
start
|
2020-04-19 20:03:12 +08:00
|
|
|
echo "restarted."
|
|
|
|
|
}
|