diff options
Diffstat (limited to 'src/netctl.in')
-rw-r--r-- | src/netctl.in | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/netctl.in b/src/netctl.in index 2d04d28..e9325e3 100644 --- a/src/netctl.in +++ b/src/netctl.in @@ -109,14 +109,15 @@ unit_enable() { echo ".include @systemdsystemunitdir@/netctl@.service" > "$unit" echo -e "\n[Unit]" >> "$unit" [[ -n $Description ]] && echo "Description=$Description" >> "$unit" - if [[ -n ${BindsToInterfaces=$Interface} ]]; then + [[ -v BindsToInterfaces ]] || BindsToInterfaces=$Interface + if (( ${#BindsToInterfaces[@]} )); then : ${InterfaceRoot=sys/subsystem/net/devices/} printf "BindsTo=$(sd_escape "$InterfaceRoot")%s.device\n" \ $(sd_escape "${BindsToInterfaces[@]}") >> "$unit" printf "After=$(sd_escape "$InterfaceRoot")%s.device\n" \ $(sd_escape "${BindsToInterfaces[@]}") >> "$unit" fi - if [[ -n $After ]]; then + if (( ${#After[@]} )); then printf 'After="netctl@%s.service"\n' \ $(sd_escape "${After[@]}") >> "$unit" fi |