]>
Commit | Line | Data |
---|---|---|
7dfa6bcf MM |
1 | #!/bin/sh |
2 | ||
3 | destunitdir=${1:-/tmp} | |
4 | ||
5 | # Do nothing if target is disabled | |
6 | [ -e /etc/systemd/system/multi-user.target.wants/swatch.target ] || exit 0 | |
7 | ||
8 | [ -f /etc/sysconfig/swatch ] && . /etc/sysconfig/swatch | |
9 | ||
10 | if [ -d $destunitdir/swatch.target.wants ]; then | |
11 | rm -f $destunitdir/swatch.target.wants/swatch@*.service | |
12 | else | |
13 | mkdir -p $destunitdir/swatch.target.wants | |
14 | fi | |
15 | ||
16 | for name in $INSTANCES; do | |
8b1f7c8b | 17 | [ -L $destunitdir/swatch.target.wants/swatch@${name}.service ] && \ |
7dfa6bcf MM |
18 | continue |
19 | ln -s /lib/systemd/system/swatch@.service \ | |
8b1f7c8b | 20 | $destunitdir/swatch.target.wants/swatch@${name}.service |
7dfa6bcf | 21 | done |