Commit b4f7bf8c authored by Jouke Witteveen's avatar Jouke Witteveen
Browse files

Fix default interface bindings (fourth time)

The following changes introduced in Bash 4.3 necessitate this commit:
- Setting the array attribute no longer initializes an array.
- Empty-but-set arrays no longer pass [[ -v ]].

Previous attempts:
feb669f4
711c4645
e8210827
parent e9c36cc1
......@@ -2,7 +2,8 @@
. "$SUBR_DIR/ip"
declare -ag BindsToInterfaces
# Make sure BindsToInterfaces is set
BindsToInterfaces=("${BindsToInterfaces[@]}")
bond_up() {
if is_interface "$Interface"; then
......
......@@ -2,7 +2,8 @@
. "$SUBR_DIR/ip"
declare -ag BindsToInterfaces
# Make sure BindsToInterfaces is set
BindsToInterfaces=("${BindsToInterfaces[@]}")
bridge_up() {
if is_interface "$Interface"; then
......
......@@ -2,7 +2,8 @@
. "$SUBR_DIR/ip"
declare -ag BindsToInterfaces
# Make sure BindsToInterfaces is set
BindsToInterfaces=("${BindsToInterfaces[@]}")
dummy_up() {
if is_interface "$Interface"; then
......
......@@ -2,7 +2,8 @@
. "$SUBR_DIR/ip"
declare -ag BindsToInterfaces
# Make sure BindsToInterfaces is set
BindsToInterfaces=("${BindsToInterfaces[@]}")
tunnel_up() {
if is_interface "$Interface"; then
......
......@@ -2,7 +2,8 @@
. "$SUBR_DIR/ip"
declare -ag BindsToInterfaces
# Make sure BindsToInterfaces is set
BindsToInterfaces=("${BindsToInterfaces[@]}")
tuntap_up() {
if is_interface "$Interface"; then
......
......@@ -111,7 +111,7 @@ unit_enable() {
echo ".include @systemdsystemunitdir@/netctl@.service" > "$unit"
echo -e "\n[Unit]" >> "$unit"
[[ -n $Description ]] && echo "Description=$Description" >> "$unit"
[[ -v BindsToInterfaces ]] || BindsToInterfaces=$Interface
declare -p BindsToInterfaces &> /dev/null || BindsToInterfaces=$Interface
if (( ${#BindsToInterfaces[@]} )); then
: ${InterfaceRoot=sys/subsystem/net/devices/}
printf "BindsTo=$(sd_escape "$InterfaceRoot")%s.device\n" \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment