summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/ffluci-system-addons/src
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/package/ffluci-system-addons/src')
-rw-r--r--contrib/package/ffluci-system-addons/src/hotplug.d-20-aliases24
-rw-r--r--contrib/package/ffluci-system-addons/src/root.crontab3
-rw-r--r--contrib/package/ffluci-system-addons/src/run-parts18
3 files changed, 45 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 0000000000..b9986e3aaa
--- /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
diff --git a/contrib/package/ffluci-system-addons/src/root.crontab b/contrib/package/ffluci-system-addons/src/root.crontab
new file mode 100644
index 0000000000..6e2e417dcb
--- /dev/null
+++ b/contrib/package/ffluci-system-addons/src/root.crontab
@@ -0,0 +1,3 @@
+0-59/1 * * * * /usr/bin/run-parts /etc/cron.minutely
+0 * * * * /usr/bin/run-parts /etc/cron.hourly
+0 0 * * * /usr/bin/run-parts /etc/cron.daily
diff --git a/contrib/package/ffluci-system-addons/src/run-parts b/contrib/package/ffluci-system-addons/src/run-parts
new file mode 100644
index 0000000000..0f0cbbdf5f
--- /dev/null
+++ b/contrib/package/ffluci-system-addons/src/run-parts
@@ -0,0 +1,18 @@
+#!/bin/sh
+set +e
+
+if [ $# -lt 1 ]; then
+ echo "Usage: run-parts <dir>"
+ exit 1
+fi
+
+if [ ! -d $1 ]; then
+ echo "Not a directory: $1"
+ exit 1
+fi
+
+for i in $1/*; do
+ [ -x $i ] && $i
+done
+
+exit 0 \ No newline at end of file