interfaces: these ip files under /tmp are not being used #5367

This commit is contained in:
Franco Fichtner 2021-11-27 13:21:57 +01:00
parent 63f92e9d4c
commit aa6ffc501d
2 changed files with 3 additions and 7 deletions

View File

@ -28,27 +28,25 @@ if [ "${AF}" = "inet" ]; then
rm -f /var/etc/nameserver_${IF}
fi
# Do not remove gateway used during filter reload.
rm -f /tmp/${IF}_router /tmp/${IF}_ip
rm -f /tmp/${IF}_router
elif [ "${AF}" = "inet6" ]; then
if [ -s "/tmp/${IF}_defaultgwv6" ]; then
GW=$(head -n 1 /tmp/${IF}_defaultgwv6)
fi
if [ -n "${GW}" -a "${DEFAULTGW}" = "${GW}" ]; then
echo "Removing stale PPPoE gateway ${GW} on ${AF}" | logger -t ppp-linkdown
route delete -${AF} default "${GW}"
fi
if [ -f "/var/etc/nameserver_v6${IF}" ]; then
# Remove old entries
for nameserver in $(cat /var/etc/nameserver_v6${IF}); do
route delete ${nameserver}
done
rm -f /var/etc/nameserver_v6${IF}
fi
# Do not remove gateway used during filter reload.
rm -f /tmp/${IF}_routerv6 /tmp/${IF}_ipv6
rm -f /tmp/${IF}_routerv6
# remove previous SLAAC addresses as the ISP may
# not respond to these in the upcoming session

View File

@ -4,7 +4,6 @@ export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
if [ "${2}" = "inet" ]; then
echo ${4} > /tmp/${1}_router
echo ${3} > /tmp/${1}_ip
if grep -q dnsallowoverride /conf/config.xml; then
# write nameservers to file
@ -26,7 +25,6 @@ if [ "${2}" = "inet" ]; then
/usr/local/sbin/configctl -d interface newip ${1}
elif [ "${2}" = "inet6" ]; then
echo ${4} | cut -d% -f1 > /tmp/${1}_routerv6
echo ${3} | cut -d% -f1 > /tmp/${1}_ipv6
if grep -q dnsallowoverride /conf/config.xml; then
# write nameservers to file