mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
32 lines
819 B
Bash
32 lines
819 B
Bash
#!/bin/sh /etc/rc.common
|
|
# Copyright 2021-2022 Vladislav Kadulin {spanky@yandex.ru}
|
|
|
|
USE_PROCD=1
|
|
START=95
|
|
STOP=01
|
|
|
|
CONFIGURATION=gpoint
|
|
|
|
start_service() {
|
|
config_load "${CONFIGURATION}"
|
|
procd_open_instance
|
|
procd_append_param command /usr/share/gpoint/gpoint
|
|
procd_set_param respawn
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_set_param pidfile /var/run/gpoint.pid
|
|
procd_close_instance
|
|
echo "gpoint service start"
|
|
}
|
|
|
|
stop_service() {
|
|
if [ -f /var/run/gpoint.pid ]; then
|
|
sessionId=$(uci get gpoint.service_settings.sessionid)
|
|
uci set gpoint.service_settings.sessionid=stop
|
|
uci commit gpoint
|
|
ubus call session destroy "{\"ubus_rpc_session\":\"${sessionId}\"}"
|
|
echo "gpoint service stop"
|
|
else
|
|
echo "gpoint not running"
|
|
fi
|
|
}
|