12345678910111213141516171819202122232425262728293031 |
- #!/bin/sh
- set -eu
- SERVICEFILE="/lib/systemd/system/softflowd@.service"
- WANTDIR="$1/softflowd.service.wants"
- CONFIG_DIR=/etc/softflowd/
- if [ -d "$CONFIG_DIR" ] ; then
- mkdir -p "$WANTDIR"
- cd "$CONFIG_DIR"
- for CONFIG in *.conf ; do
- [ -f "$CONFIG" ] || continue
- INSTANCE="$(systemd-escape "${CONFIG%%.conf}")"
- LINK="$WANTDIR/softflowd@$INSTANCE.service"
- sh -n "$CONFIG_DIR$CONFIG" 2>/dev/null || continue
- interface=
- options=
- . "$CONFIG_DIR$CONFIG"
- [ "$interface" ] || continue
- ln -s "$SERVICEFILE" "$LINK"
- done
- fi
- exit 0
|