diff options
Diffstat (limited to 'net/openvpn/files/etc/hotplug.d')
-rw-r--r-- | net/openvpn/files/etc/hotplug.d/openvpn/01-user | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/net/openvpn/files/etc/hotplug.d/openvpn/01-user b/net/openvpn/files/etc/hotplug.d/openvpn/01-user new file mode 100644 index 000000000..f93823e5c --- /dev/null +++ b/net/openvpn/files/etc/hotplug.d/openvpn/01-user @@ -0,0 +1,22 @@ +#!/bin/sh + +. /lib/functions/openvpn.sh + +[ -e "/etc/openvpn.user" ] && { + env -i ACTION="$ACTION" INSTANCE="$INSTANCE" \ + /bin/sh \ + /etc/openvpn.user \ + $* +} + +# Wrap user defined scripts on up/down events +case "$ACTION" in + up|down) + if get_openvpn_option "$config" command "$ACTION"; then + shift + exec /bin/sh -c "$command $*" + fi + ;; +esac + +exit 0 |