random- collection of un-sorted bollocks |
git clone git://git.acid.vegas/random.git |
Log | Files | Refs | Archive |
v6 (747B)
1 #!/bin/sh 2 # ipv6 clone helper script - developed by acidvegas (https://git.acid.vegas/random) 3 interface='eth0' 4 subnet='2607:5300:201:3000:' 5 6 rnd() { 7 echo $(tr -dc 'A-F0-9' < /dev/urandom | head -c4) 8 } 9 10 usage() { 11 echo "v6 add <num> | generate & add <nun> ipv6 addresses (saved to ~/.v6.log)" 12 echo "v6 del | delete all ipv6 addresses created by this script" 13 } 14 15 if [ "$#" = '2' ]; then 16 if [ "$1" = 'add' ]; then 17 for i in $(seq $2); do 18 address = "$subnet:$(rnd):$(rnd):$(rnd):$(rnd)" 19 sudo ip addr add $address dev $1 20 echo $address 21 echo $address >> .v6.log 22 done 23 elif [ "$1" = 'del' ]; then 24 while IFS= read -r address; do 25 sudo ip addr del $address dev $interface 26 done < .v6.log 27 rm .v6.log 28 else 29 usage 30 else 31 usage 32 fi