mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-31 20:25:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
+46
@@ -0,0 +1,46 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
START=98
|
||||
|
||||
PROG=/usr/sbin/beardropper
|
||||
SERVICE_DAEMONIZE=1
|
||||
SERVICE_WRITE_PID=1
|
||||
|
||||
getKids() {
|
||||
egrep "^PPid: *$1$" /proc/[0-9]*/s*s 2>/dev/null | cut -f3 -d/ | xargs echo
|
||||
}
|
||||
|
||||
start() {
|
||||
service_start ${PROG} -m follow
|
||||
echo "beardropper started!"
|
||||
}
|
||||
|
||||
stop() {
|
||||
#PID=`cat /var/run/bearDropper.pid`
|
||||
#kill `getKids $PID`
|
||||
kill -9 `pgrep -f /usr/sbin/beardropper`
|
||||
sleep 1
|
||||
service_stop ${PROG}
|
||||
echo "beardropper exit...."
|
||||
}
|
||||
|
||||
restart() {
|
||||
enabled=$(uci get beardropper.@beardropper[0].enabled)
|
||||
pgrep -f ${PROG} >/dev/null
|
||||
if [ $? -eq 0 ];then #running
|
||||
if [ $enabled -eq 1 ]; then
|
||||
stop
|
||||
sleep 1
|
||||
echo "beardropper is restarting..."
|
||||
start
|
||||
else
|
||||
stop
|
||||
fi
|
||||
else
|
||||
if [ $enabled -eq 1 ]; then
|
||||
start
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user