[local/dovecot-user-add] ~correction champ from du courriel de bienvenu
[lhc/ateliers.git] / remote / runit-configure
1 #!/bin/sh -eu
2 # SYNTAX: $sv [...] -- $sv_options
3 tool=$(readlink -e "${0%/*}/..")
4 . "$tool"/remote/lib.sh
5
6 if test $# = 0
7 then
8 set +x
9 "$tool"/remote/ssh sudo sv status \
10 $(sudo find /etc/sv \
11 -mindepth 1 -maxdepth 1 -type d \
12 -printf '%p\n' | sort)
13 else
14 services=
15 while [ $# -gt 0 ]
16 do case $1 in
17 (--) shift; break;;
18 (*) services="$services ${1#etc/sv/}"; shift;;
19 esac
20 done
21 for sv in $(find "$tool"/etc/sv \
22 -mindepth 1 -maxdepth 1 -type d \
23 -false $(printf -- '-or -name %s\n' $services) \
24 -printf '%f\n')
25 do
26 (
27 cd /
28 test ! -r "$tool"/etc/sv/"$sv"/remote.sh ||
29 . "$tool"/etc/sv/"$sv"/remote.sh || return 1
30 )
31 done
32 fi