#!/bin/sh

# MEDIACASTER_DIR is set in the environment
VPN_FIREWALL_SCRIPT="${MEDIACASTER_DIR}/sbin/host/vpn-firewall.sh"
BUSYBOX="${MEDIACASTER_DIR}/bin/busybox"
VPN_FIREWALL_LOG_NAME="mc.vpn-firewall"

logger "${VPN_FIREWALL_LOG_NAME}[$$]" -p "daemon.info" "Removing VPN firewall rules"

if [ -x "${VPN_FIREWALL_SCRIPT}" ]; then
	${BUSYBOX} ash ${VPN_FIREWALL_SCRIPT} stop 2>&1 | logger "${VPN_FIREWALL_LOG_NAME}[$$]" -p "daemon.info"
	exit $?
fi

exit 127
