HEX
Server: Apache/2.4.63 (Unix)
System: Linux TOMS-220NAS 4.4.302+ #86009 SMP Wed Nov 26 18:19:17 CST 2025 x86_64
User: flavio87 (1026)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: //proc/25618/root/etc/ppp/ip-down
#!/bin/sh

VPN_IP_DOWN="/usr/syno/etc.defaults/synovpnclient/scripts/ip-down"
RELAYDAEMON="/usr/syno/sbin/synorelayd"
SYNONETD_TOOL="/usr/syno/sbin/synonetdtool"
DEFAULT_GATEWAY_FILE="/etc/iproute2/config/default-gateway"

. /etc/ppp/ip-function

logger -p user.err -t "/etc/ppp/ip-down" "${IFNAME} is down"

if [ -n "${LINKNAME}" -a -x "${VPN_IP_DOWN}" ]; then
	${VPN_IP_DOWN} &
fi

TC_SCRIPT="/usr/syno/bin/synotc_common"

if [ -x "${TC_SCRIPT}" ]; then
	${TC_SCRIPT} restart /etc/tc
fi
${RELAYDAEMON} -U

default_gateway=`/usr/syno/bin/synogetkeyvalue ${DEFAULT_GATEWAY_FILE} DEVICE`
if [ "x${default_gateway}" = "x${IFNAME}" ]; then
	/usr/syno/bin/synosetkeyvalue ${DEFAULT_GATEWAY_FILE} DEVICE ""
fi

${SYNONETD_TOOL} --del-gateway-info -4 ${IFNAME}
${SYNONETD_TOOL} --refresh-gateway -4

enable_multi_gateway=`/bin/get_key_value /etc/synoinfo.conf multi_gateway`
if [ "xyes" = "x${enable_multi_gateway}" ]; then
	${SYNONETD_TOOL} --del-policy-route-rule -4 multi-gateway ${IFNAME}
	${SYNONETD_TOOL} --disable-route-table -4 ${IFNAME}
fi