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

33 lines
805 B
Bash
Executable File

#!/bin/sh
# /etc/bewan/scripts/ip-up6-static
# called when in static mode
# setparam is already included by calling script
# Environnement variables:
# IFNAME: interface name
# IPADDR: IP address
# PREFIX: interface prefix
# ROUTERS: gateways
PREFIX="${PREFIX:-}"
prefixlen=128
[ "$PREFIX" != "" ] && prefixlen=${PREFIX##*/}
base_log "$SCRIPTD/ip-up6-static $IFNAME $IPADDR/$prefixlen gw $ROUTERS" debug
# LAN network interface is up
if [ -f "$INTFD/$IFNAME/lanid" ]; then
LANID=`cat $INTFD/$IFNAME/lanid`
ip -6 addr add $IPADDR/$prefixlen dev $IFNAME
base_call_scripts 'ip-up6-lan'
# DHCP client is up on WAN side
elif [ -f "$INTFD/$IFNAME/wanid" ]; then
WANID=`cat $INTFD/$IFNAME/wanid`
ip -6 addr add $IPADDR/$prefixlen dev $IFNAME
IPREMOTE=''
base_call_scripts 'ip-up6'
fi