Corrections: etc/nsd/zone.d/* - Champ SPF déprécié
[lhc/ateliers.git] / local / runit-configure
1 #!/bin/sh -eu
2 # SYNTAX: $sv [...] -- $sv_options
3 tool=$(readlink -e "${0%/*}/..")
4 . "$tool"/local/lib.sh
5
6 "$tool"/local/apt-get-install runit
7 if test $# = 0
8 then
9 set +x
10 sudo sv status \
11 $(sudo find /etc/sv \
12 -mindepth 1 -maxdepth 1 -type d \
13 -printf '%p\n' | sort)
14 else
15 services=
16 while [ $# -gt 0 ]
17 do case $1 in
18 (--) shift; break;;
19 (*) services="$services ${1#/etc/sv/}"; shift;;
20 esac
21 done
22 #for sv in $(sudo find /etc/sv \
23 # -mindepth 1 -maxdepth 1 -type d \
24 # -false $(printf -- '-or -name %s\n' $services) \
25 # -printf '%f\n')
26 # do
27 # case $(sudo sv stop "$sv" | tee /dev/stderr) in
28 # (*": runsv not running") true;;
29 # (*": unable to open supervise/ok: file does not exist") true;;
30 # ("ok: down:"*) true;;
31 # (*) false;;
32 # esac
33 # done
34 for sv in $(find "$tool"/etc/sv \
35 -mindepth 1 -maxdepth 1 -type d \
36 -false $(printf -- '-or -name %s\n' $services) \
37 -printf '%f\n')
38 do
39 "$tool"/local/runit-sv-configure "$sv" "$@"
40 "$tool"/local/runit-sv-start "$sv"
41 done
42 #sleep 3
43 #sudo find -L /etc/service -type l -delete
44 fi