Advertisement
Guest User

nsupdate

a guest
Mar 10th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #!/bin/sh
  2. if which nsupdate >/dev/null; then
  3.  
  4. ETH=vpnbas
  5. DOMAIN=router.nnxx
  6. DNS=10.27.253.10
  7. SUB=$(cat /proc/sys/kernel/hostname)
  8. ECHO=$(which echo)
  9. NSUPDATE=$(which nsupdate)
  10. IP=$(ip addr show dev $ETH | grep 'inet ' | awk '{split($2,a,"/");print a[1];}')
  11.  
  12. $ECHO "server $DNS" > /tmp/nsupdate
  13. $ECHO "debug yes" >> /tmp/nsupdate
  14. $ECHO "zone $DOMAIN." >> /tmp/nsupdate
  15. $ECHO "update delete $SUB.$DOMAIN" >> /tmp/nsupdate
  16. $ECHO "update add $SUB.$DOMAIN 60 A $IP" >> /tmp/nsupdate
  17. $ECHO "debug" >> /tmp/nsupdate
  18. $ECHO "send" >> /tmp/nsupdate
  19.  
  20. $NSUPDATE -v /tmp/nsupdate 2>&1
  21.  
  22. else
  23. echo installo nsupdate, riavvia lo script dopo
  24. sleep 5
  25. opkg update
  26. opkg install bind-client
  27. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement