summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/ffluci-system-addons/src/hotplug.d-20-aliases
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/package/ffluci-system-addons/src/hotplug.d-20-aliases')
-rw-r--r--contrib/package/ffluci-system-addons/src/hotplug.d-20-aliases24
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/package/ffluci-system-addons/src/hotplug.d-20-aliases b/contrib/package/ffluci-system-addons/src/hotplug.d-20-aliases
new file mode 100644
index 000000000..b9986e3aa
--- /dev/null
+++ b/contrib/package/ffluci-system-addons/src/hotplug.d-20-aliases
@@ -0,0 +1,24 @@
+add_aliases() {
+ local config="$1"
+
+ config_get base "$INTERFACE" ifname
+ config_get iface "$config" ifname
+ config_get ipaddr "$config" ipaddr
+ config_get auto "$config" auto
+
+ [ "${iface%%:*}" == "$base" -a "$iface" != "$base" ] && {
+ case "$auto" in
+ 1|on|enabled) setup_interface "$iface" "$config";;
+ *) return 1;;
+ esac
+ }
+}
+
+
+case "$ACTION" in
+ ifup)
+ include /lib/network
+ scan_interfaces
+ config_foreach "add_aliases" interface
+ ;;
+esac