1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00
openmptcprouter-feeds/openvpn/files/etc/hotplug.d/openvpn/01-user
Ycarus (Yannick Chabanois) 8c9688f82f Update OpenVPN to 2.6.9
2024-03-13 09:44:10 +01:00

27 lines
633 B
Bash

#!/bin/sh
[ -e "/etc/openvpn.user" ] && {
env -i ACTION="$ACTION" INSTANCE="$INSTANCE" \
/bin/sh \
/etc/openvpn.user \
$*
}
# Wrap user defined scripts on up/down/route-up/route-pre-down/ipchange events
# Scriptp set with up/down/route-up/route-pre-down/ipchange in the openvpn config are also executed with the command=user_xxxx
case "$ACTION" in
up) command=$user_up ;;
down) command=$user_down ;;
route-up) command=$user_route_up ;;
route-pre-down) command=$user_route_pre_down ;;
ipchange) command=$user_ipchange ;;
*) command= ;;
esac
if [ -n "$command" ]; then
shift
exec /bin/sh -c "$command $*"
fi
exit 0