Advertisement
eliaspolicena

restart-ipv6.sh

Feb 24th, 2021
1,000
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.49 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. value=`ifstatus wan | jq -r '.uptime'`
  4. if [ "$value" -lt "600" ] ;then
  5.     vRx=`awk '/:/ { print($1,$3, $11) }' < /proc/net/dev | grep hene5 | awk '{print $3;}'`
  6.     vTx=`awk '/:/ { print($1,$3, $11) }' < /proc/net/dev | grep hene5 | awk '{print $2;}'`
  7.     #echo "TX: $vTx RX: $vRx"
  8.     if [ "$vRx" = "0" ] || [ "$vTx" = "0" ] ;then
  9.         ifdown hene5 && ifup hene5
  10.         /etc/init.d/resolver restart
  11.         curl -X GET http://ipv6.google.com
  12.         /srv/scripts/dig.sh
  13.         /etc/init.d/ddns restart
  14.     fi
  15. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement