Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- cfg=/etc/tinc
- myip=$(awk -F' *= *|/' '/Subnet.*\/32$/{print$2}' $cfg/$NETNAME/hosts/$NAME)
- ifconfig $INTERFACE $myip/24
- cd /etc/tinc/$NETNAME/hosts
- for i in *; do
- [ "$i" = "$NAME" ] && continue
- eval $(awk -F' *= *|/' '/Subnet.*\//{if($3 == 32)gw=$2;else net=$2"/"$3}END{print "ip route add "net" via "gw}' $i)
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement