examples/var_service/: use "svc" for service commands, other tweaks

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2018-07-03 17:02:50 +02:00
parent e5d5f5b9a7
commit aa75a7da7f
8 changed files with 35 additions and 30 deletions

View File

@ -21,9 +21,9 @@ if test -f "$0.log"; then
mv "$0.log.new" "$0.log"
fi
test -f "/var/service/dhcp_$if/env.out" || exec env - sleep "$ping_time"
test -f "../dhcp_$if/env.out" || exec env - sleep "$ping_time"
. "/var/service/dhcp_$if/env.out"
. "../dhcp_$if/env.out"
test x"$router" != x"" || exec env - sleep "$ping_time"
#msg "Pinging $router"
@ -36,12 +36,12 @@ while true; do
env - sleep "$retry_time"
done
test -d "/var/service/dhcp_$if" && {
msg "Restarting /var/service/dhcp_$if"
sv t "/var/service/dhcp_$if"
test -d "../dhcp_$if" && {
msg "Restarting dhcp_$if"
svc -t "dhcp_$if"
}
test -d "/var/service/supplicant_$if" && {
msg "Restarting /var/service/supplicant_$if"
sv t "/var/service/supplicant_$if"
test -d "../supplicant_$if" && {
msg "Restarting supplicant_$if"
svc -t "supplicant_$if"
}
exec env - sleep "$ping_time"