123456789101112131415161718192021222324252627282930 |
- #!/bin/sh
- set -eu
- service_file="/lib/systemd/system/softflowd@.service"
- want_dir="$1/softflowd.service.wants"
- config_dir=/etc/softflowd/
- if [ -d "$config_dir" ]; then
- mkdir -p "$want_dir"
- cd "$config_dir"
- for config in *.conf; do
- [ -f "$config" ] || continue
- instance="$(systemd-escape "${config%%.conf}")"
- link="$want_dir/softflowd@$instance.service"
- sh -n "$config_dir$config" 2>/dev/null || continue
- interface=
- . "$config_dir$config"
- [ "$interface" ] || continue
- ln -s "$service_file" "$link"
- done
- fi
- exit 0
|