Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- ns=${PPP_IFACE#*-}
- . /etc/ovhpass
- domain=$ns.teknoraver.net
- # create bind mount in /var/run/netns
- if ! [ -d /var/run/netns ]; then
- ip netns add $$
- ip netns del $$
- fi
- pid=$(machinectl show -p Leader --value $ns)
- nsmount=/var/run/netns/$ns
- >$nsmount
- mount --bind /proc/$pid/ns/net $nsmount
- ip link set dev $PPP_IFACE netns $ns
- ip -n $ns addr add dev $PPP_IFACE $IPLOCAL/32
- ip -n $ns link set dev $PPP_IFACE up
- ip -n $ns route del default
- ip -n $ns route add default dev $PPP_IFACE
- ip netns exec $ns curl -s "http://$user:$pass@www.ovh.com/nic/update?system=dyndns&hostname=$domain"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement