mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-03 07:54:28 +01:00
32 lines
1.1 KiB
Bash
32 lines
1.1 KiB
Bash
#!/bin/sh
|
|
/etc/init.d/6relayd enabled || exit 0
|
|
[ -n "$INTERFACE" ] || exit 0
|
|
|
|
. /lib/functions/network.sh
|
|
mkdir -p /tmp/ipv6
|
|
|
|
local prevprefix6=""
|
|
local curprefix6=""
|
|
local prefix6file=/tmp/ipv6/$INTERFACE-prefix6
|
|
prevprefix6=$(cat $prefix6file 2>/dev/null)
|
|
network_get_prefix6 curprefix6 $INTERFACE
|
|
[ -n "$curprefix6" ] && echo $curprefix6 > $prefix6file || rm -f $prefix6file
|
|
|
|
local prevgateway6=""
|
|
local curgateway6=""
|
|
local gateway6file=/tmp/ipv6/$INTERFACE-gateway6
|
|
prevgateway6=$(cat $gateway6file 2>/dev/null)
|
|
network_get_gateway6 curgateway6 $INTERFACE
|
|
[ -n "$curgateway6" ] && echo $curgateway6 > $gateway6file || rm -f $gateway6file
|
|
|
|
local prevsubnets6=""
|
|
local cursubnets6=""
|
|
local subnets6file=/tmp/ipv6/$INTERFACE-subnets6
|
|
prevsubnets6=$(cat $subnets6file 2>/dev/null)
|
|
network_get_subnets6 cursubnets6 $INTERFACE
|
|
[ -n "$cursubnets6" ] && echo $cursubnets6 > $subnets6file || rm -f $subnets6file
|
|
|
|
[ "$prevprefix6" = "$curprefix6" -a "$prevgateway6" = "$curgateway6" -a "$prevsubnets6" = "$cursubnets6" ] && exit 0
|
|
|
|
. /etc/init.d/6relayd
|
|
restart_affected "$INTERFACE"
|