summaryrefslogtreecommitdiffstats
path: root/src/netctl.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/netctl.in')
-rw-r--r--src/netctl.in5
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