summaryrefslogtreecommitdiff
path: root/preinst-runit
blob: 23d87924852e43150e70f4b6ce13bd6d35c13c04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- shell-script -*-
SV_CURRENT=/etc/runit/runsvdir/current
SV_DEFAULT=/etc/runit/runsvdir/default
SV_DIR=/etc/service

if [ ! -e "$SV_CURRENT" ] ; then
    ln -s default "$SV_CURRENT"
elif [ ! -L "$SV_CURRENT" ] ; then
    echo "unsupported: $SV_CURRENT exists, but is not symbolic link"
    exit 1
fi

if [ ! -e "$SV_DIR" ] ; then
    ln -sn "$SV_CURRENT" "$SV_DIR"
fi

if [ "$(readlink "$SV_DIR")" != "$SV_CURRENT" ] ; then
    echo "unsupported: $SV_DIR exists, but does not point to $SV_CURRENT"
    exit 1
fi

# Local Variables:
# eval: (sh-set-shell "sh" t nil)
# End: