File: unset_addrs.sh

package info (click to toggle)
radvd 1%3A2.20-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,416 kB
  • sloc: ansic: 5,780; sh: 5,467; yacc: 1,002; makefile: 265; lex: 168
file content (17 lines) | stat: -rwxr-xr-x 236 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

set -u

if (( $# < 1 )) ; then
	echo "usage: $0 iface" 1>&2
	exit -1
fi

iface=$1

ADDRS=$(ifconfig $iface | grep "inet6 addr:" | grep Scope:Global | awk '{print $3}')

for a in $ADDRS ; do
	ip addr del $a dev $iface
done