1
0
This repository has been archived on 2025-01-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Anderson Luiz Alves 0464e230c1 stock 103961
2017-07-30 16:48:04 -03:00

39 lines
921 B
Bash
Executable File

#!/bin/sh
# Network interface is down (from PPP client)
# Environnement variables:
# IFNAME: $1, interface name (pppi)
IFNAME=${1:-}
. /etc/bewan/scripts/globals
. /etc/bewan/lib/base
base_log "$SCRIPTD/ppp-down6 $IFNAME" debug
# PPP down on WAN interface
[ -f "$INTFD/$IFNAME/wanid" ] || exit 0
WANID=`cat $INTFD/$IFNAME/wanid`
# Take wan-up-down mutex
base_enter_critical 'wan-up-down'
# Get config parameters after taking lock
base_call_initd 'setparam'
# PPP on demand
# Triggers a down / up on the interface
# The SNAT module is listening to this kind of event
# and will flush the conntrack table
if [ -f "$WAND/$WANID/ip6/fakeip" ]; then
ifconfig $IFNAME down up
fi
# If we have a WANIP6Connection configured, it will configure this interface for ipv6
if [ -f $WAND/$WANID/wan_ip6 ]; then
ARG=stop
base_call_initd 'wanip6 inittab'
fi
# Release wan-up-down mutex
base_exit_critical 'wan-up-down'