ssm-services/init.d/lo.iface
fbt 2205f72a2e watchman -> ssm
Signed-off-by: fbt <fbt@fleshless.org>
2017-07-13 16:09:42 +03:00

22 lines
371 B
Plaintext
Executable File

#!/usr/bin/env ssm
cfg_iface="${service_name%%.*}"
service_type='oneshot'
service_command='/usr/bin/ip'
service_args=( link set "$cfg_iface" up)
ready() {
local iface="$1" timer='0' timeout='6'
until [[ "$(ip link show $iface up)" ]]; do
(( timer >= timeout )) && { return 1; }
(( timer++ ))
done
}
pre_stop() {
ip link set "${cfg_iface}" down
super_stop
}