mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 14:23:38 +00:00
Luci-app-nps change to use procd init script (#1895)
* Add luci-app-nps https://github.com/cnlh/nps * Luci-app-nps change to use procd init script * optimize Shell script
This commit is contained in:
parent
ff6b0c1c67
commit
cf19c5720c
@ -2,8 +2,7 @@
|
|||||||
# Copyright (C) 2006-2011 OpenWrt.org
|
# Copyright (C) 2006-2011 OpenWrt.org
|
||||||
|
|
||||||
START=50
|
START=50
|
||||||
SERVICE_WRITE_PID=1
|
USE_PROCD=1
|
||||||
SERVICE_DAEMONIZE=1
|
|
||||||
|
|
||||||
LOGFILE="/var/etc/nps.log"
|
LOGFILE="/var/etc/nps.log"
|
||||||
tmpconf="/tmp/etc/nps.conf"
|
tmpconf="/tmp/etc/nps.conf"
|
||||||
@ -46,23 +45,20 @@ nps_write_bool() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start_service() {
|
||||||
config_load nps
|
config_load nps
|
||||||
config_foreach nps_header nps
|
config_foreach nps_header nps
|
||||||
|
|
||||||
if [ "$Enabled" = "0" ];then
|
if [ "$Enabled" = "1" ];then
|
||||||
stop
|
logger -t FRPC 'Starting Nps service'
|
||||||
else
|
#service_start /usr/bin/npc -config=$tmpconf -log_level=$Log_level -log_path=$LOGFILE
|
||||||
logger -t FRPC 'Starting Nps service'
|
procd_open_instance
|
||||||
service_start /usr/bin/npc -config=$tmpconf -log_level=$Log_level -log_path=$LOGFILE
|
procd_set_param command /usr/bin/npc -config=$tmpconf -log_level=$Log_level
|
||||||
|
procd_set_param file $tmpconf
|
||||||
|
procd_set_param respawn
|
||||||
|
procd_set_param stdout 1
|
||||||
|
procd_set_param stderr 1
|
||||||
|
procd_close_instance
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
|
||||||
service_stop /usr/bin/npc
|
|
||||||
rm $tmpconf
|
|
||||||
logger -t FRPC 'Nps service stopped'
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user