OpenWRT 使用 watchdog 重啟網路

本文阅读 1 分钟
首页 未分類 正文

編寫:/root/wan-watchdog.sh

  1. #!/bin/sh
  2. tries=0
  3. while [[ $tries -lt 5 ]]
  4. do
  5. if /bin/ping -c 1 100.64.6.1 >/dev/null
  6. then
  7. exit 0
  8. fi
  9. tries=$((tries+1))
  10. /etc/init.d/network restart
  11. exit 0
  12. done
  13. exit 0

之後到 System → Scheduled Tasks 加入:

  1. * * * * * /root/wan-watchdog.sh

參考資料:
OpenWrt WAN watchdog (2013)

本文来自投稿,不代表本站立场,如若转载,请注明出处:
H3C 設定 SSH 登入
« 上一篇 04-13
mt7921e 模組於 Debian 系統上使用
下一篇 » 10-10