watchman -> ssm

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
2017-07-13 16:09:42 +03:00
parent 3953df0dba
commit 2205f72a2e
71 changed files with 198 additions and 212 deletions

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env watchman
#!/usr/bin/env ssm
cfg_iface="${service_name%%.*}"
@@ -6,7 +6,7 @@ service_type='oneshot'
service_command='/usr/bin/ip'
service_args=( link set "$cfg_iface" up)
wait_for_iface() {
ready() {
local iface="$1" timer='0' timeout='6'
until [[ "$(ip link show $iface up)" ]]; do
@@ -15,18 +15,7 @@ wait_for_iface() {
done
}
start() {
watchman.msg "Activating the $cfg_iface interface..."
watchman.start
wait_for_iface || {
echo "Interface $cfg_iface failed to come up!"
return 1
}
}
stop() {
watchman.msg "Deactivating the $cfg_iface interface..."
pre_stop() {
ip link set "${cfg_iface}" down
watchman.stop
super_stop
}