openvpn: import from base

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-12-01 12:36:46 -08:00
parent 0e77d0264e
commit 4434915571
18 changed files with 1564 additions and 0 deletions
@@ -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
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
#
# This file is interpreted as shell script.
# Put your custom openvpn action here, they will
# be executed with each opevnp event.
#
# $ACTION
# <down> down action is generated after the TUN/TAP device is closed
# <up> up action is generated after the TUN/TAP device is opened
# $INSTANCE Name of the openvpn instance which went up or down