]> git.pld-linux.org Git - packages/ucarp.git/blob - ucarp-service-generator
rel 4; systemd support
[packages/ucarp.git] / ucarp-service-generator
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/ucarp.target ] || exit 0
7
8 [ -f /etc/sysconfig/ucarp ] && . /etc/sysconfig/ucarp
9
10 if [ -d $destunitdir/ucarp.target.wants ]; then
11         rm -f $destunitdir/ucarp.target.wants/ucarp@*.service
12 else
13         mkdir -p $destunitdir/ucarp.target.wants
14 fi
15
16 for ip in $VIRTUAL_IPS; do
17         [ -L $destunitdir/ucarp.target.wants/ucarp@$ip.service ] && \
18                 continue
19         ln -s /lib/systemd/system/ucarp@.service \
20                 $destunitdir/ucarp.target.wants/ucarp@$ip.service
21 done
This page took 0.146852 seconds and 3 git commands to generate.