|
@@ -316,7 +316,9 @@ start_service() {
|
|
|
fi
|
|
fi
|
|
|
if [ "$enabled" == "1" ]; then
|
|
if [ "$enabled" == "1" ]; then
|
|
|
procd_open_instance
|
|
procd_open_instance
|
|
|
- procd_set_param respawn
|
|
|
|
|
|
|
+ procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
|
|
|
|
|
+ procd_set_param limits core="unlimited"
|
|
|
|
|
+ procd_set_param stderr 1
|
|
|
# pass config to script on start
|
|
# pass config to script on start
|
|
|
procd_set_param command $binpath $ADDITIONAL_ARGS
|
|
procd_set_param command $binpath $ADDITIONAL_ARGS
|
|
|
procd_close_instance
|
|
procd_close_instance
|
|
@@ -324,8 +326,7 @@ start_service() {
|
|
|
do_redirect 1
|
|
do_redirect 1
|
|
|
fi
|
|
fi
|
|
|
echo "AdGuardHome turn on"
|
|
echo "AdGuardHome turn on"
|
|
|
- echo "enabled="$enabled""
|
|
|
|
|
- uci set $CONFIGURATION.$CONFIGURATION.lastbinpath=$binpath
|
|
|
|
|
|
|
+ echo "enabled=$enabled"
|
|
|
fi
|
|
fi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -333,10 +334,8 @@ stop_service()
|
|
|
{
|
|
{
|
|
|
config_get configpath $CONFIGURATION configpath "/etc/AdGuardHome.yaml"
|
|
config_get configpath $CONFIGURATION configpath "/etc/AdGuardHome.yaml"
|
|
|
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome/AdGuardHome"
|
|
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome/AdGuardHome"
|
|
|
- mkdir -p ${binpath%/*}
|
|
|
|
|
do_redirect 0
|
|
do_redirect 0
|
|
|
- config_get lastbinpath $CONFIGURATION lastbinpath $binpath
|
|
|
|
|
- pgrep $lastbinpath | xargs kill
|
|
|
|
|
|
|
+ procd_send_signal $CONFIGURATION
|
|
|
echo "AdGuardHome turn off"
|
|
echo "AdGuardHome turn off"
|
|
|
- echo "enabled="$enabled""
|
|
|
|
|
|
|
+ echo "enabled=$enabled"
|
|
|
}
|
|
}
|