mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-31 06:05:13 +08:00
update 2026-05-10 09:48:30
This commit is contained in:
1 parent
95ac96413e
commit
0b362674f1
6244 files changed
+2992248
No files matched your search
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=90
|
||||
USE_PROCD=1
|
||||
|
||||
dir="/tmp/wechatpush/"
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
enable_value=$(uci get wechatpush.config.enable 2>/dev/null || echo "0")
|
||||
[ "$enable_value" -ne "0" ] && procd_set_param command /usr/share/wechatpush/wechatpush && echo "wechatpush is starting now ..."
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
[ -f ${dir}child_pid ] && parent_pid=$(cat ${dir}child_pid)
|
||||
[ -n "$parent_pid" ] && {
|
||||
child_pids=$(pgrep -P $parent_pid)
|
||||
echo "Terminating child processes of wechatpush..."
|
||||
for child_pid in $child_pids; do
|
||||
kill $child_pid
|
||||
done
|
||||
}
|
||||
local pids=$(ps | grep "wechatpush" | grep -v grep | grep -v $$ | awk '{print $1}')
|
||||
[ -n "$pids" ] && echo "$pids" | xargs kill 2>/dev/null
|
||||
echo "Terminating wechatpush process..."
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger wechatpush
|
||||
}
|
||||
Reference in new issue
Block a user