summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-12-15 18:27:18 +0100
committerChristian Poessinger <christian@poessinger.com>2020-12-15 18:27:18 +0100
commiteb1eb17b04872873273ccfe7d029626b6f466c1b (patch)
tree853664dc2d209e529718ac2e97e94e8dddd6f760 /data
parent463318d65f4988bc1bae4a42c220e5b12fedf506 (diff)
downloadvyos-build-eb1eb17b04872873273ccfe7d029626b6f466c1b.tar.gz
vyos-build-eb1eb17b04872873273ccfe7d029626b6f466c1b.zip
netplug: T3130: add VyOS specific helper script
Diffstat (limited to 'data')
-rwxr-xr-xdata/live-build-config/includes.chroot/etc/netplug/netplug29
1 files changed, 29 insertions, 0 deletions
diff --git a/data/live-build-config/includes.chroot/etc/netplug/netplug b/data/live-build-config/includes.chroot/etc/netplug/netplug
new file mode 100755
index 00000000..699be5fd
--- /dev/null
+++ b/data/live-build-config/includes.chroot/etc/netplug/netplug
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# vyos policy agent for netplugd
+#
+
+dev="$1"
+action="$2"
+
+case "$action" in
+in)
+ run-parts -a $dev /etc/netplug/linkup.d
+ ;;
+out)
+ run-parts -a $dev /etc/netplug/linkdown.d
+ ;;
+
+# probe loads and initialises the driver for the interface and brings the
+# interface into the "up" state, so that it can generate netlink(7) events.
+# This interferes with "admin down" for an interface. Thus, commented out. An
+# "admin up" is treated as a "link up" and thus, "link up" action is executed.
+# To execute "link down" action on "admin down", run appropriate script in
+# /etc/netplug/linkdown.d
+#probe)
+# ;;
+
+*)
+ exit 1
+ ;;
+esac