mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-01 11:23:56 +08:00
update 2026-07-28 01:38:11
This commit is contained in:
1 parent
20b786ab77
commit
25d570431d
6243 files changed
+2850542
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