Witam
Mam w cron-ie ustawione czuwanie nad podniesieniem internetu w przypadku jego zerwania (test wykonuję bez karty SIM)
root@ROD:/# crontab -l
0 0 * * * /etc/init.d/acme start
6 2 * * * /sbin/stat.sh
* * * * * /usr/bin/wireguard_watchdog
*/6 * * * * /bin/twan
*/9 * * * * /bin/tres
root@ROD:/# cat /bin/twan
if ! ping -q -c 2 -W 15 google.com >> /dev/null ; then
(/etc/init.d/network restart ) &
fi
root@ROD:/bin# cat /bin/tres
#!/bin/sh
if ! ping -q -c 2 -W 30 google.com > /dev/null; then
(reboot ) &
fi
Nie wiem dlaczego ale po 6 minucie od razu restartuje router zamiast interfejsy sieciowe poleceniem /etc/init.d/network restart a dopiero po nastęnych 3 minutach powinien być restart routera
Z logu uruchomienie cron-a 13:00:00
Poniżej log
Thu Apr 28 12:59:54 2022 daemon.notice netifd: wg0 (5987): Try again: `piratee.no-ip.pl:55055'. Trying again in 3.58 seconds...
Thu Apr 28 12:59:57 2022 daemon.notice netifd: wan (6368): sending -> AT+CFUN=1
Thu Apr 28 12:59:57 2022 daemon.notice netifd: wan (6368): Configuring modem
Thu Apr 28 12:59:58 2022 daemon.notice netifd: wan (6368): sending -> AT+ZGDCONT=1,"IP","darmowy","",0,0
Thu Apr 28 13:00:00 2022 cron.err crond[2650]: USER root pid 6536 cmd /usr/bin/wireguard_watchdog
Thu Apr 28 13:00:00 2022 cron.err crond[2650]: USER root pid 6537 cmd /bin/twan
Thu Apr 28 13:00:00 2022 cron.err crond[2650]: USER root pid 6538 cmd /bin/tres
Thu Apr 28 13:00:03 2022 daemon.notice netifd: wan (6368): Error running AT-command
Thu Apr 28 13:00:03 2022 daemon.notice netifd: wan (6368): Failed to configure modem
Thu Apr 28 13:00:03 2022 daemon.notice netifd: wan (6557): Stopping network wan
Thu Apr 28 13:00:03 2022 daemon.notice netifd: wg0 (5987): Try again: `piratee.no-ip.pl:55055'. Trying again in 4.30 seconds...
Thu Apr 28 13:00:05 2022 daemon.info procd: - shutdown -
Thu Apr 28 13:00:05 2022 daemon.notice netifd: wan (6557): sending -> AT+ZGACT=0,1
Thu Apr 28 13:00:06 2022 daemon.notice ksmbd: Stopping Ksmbd userspace service.
[ 303.085601] br-lan: port 3(wlan0) entered disabled state
[ 303.091237] br-lan: port 2(wlan1) entered disabled state
[ 303.096776] br-lan: port 1(eth0.1) entered disabled state
[ 303.224590] device eth0.1 left promiscuous mode
[ 303.229359] device eth0 left promiscuous mode
[ 303.234009] br-lan: port 1(eth0.1) entered disabled state
[ 303.348710] eth0: link down
[ 303.398410] device wlan0 left promiscuous mode
[ 303.403133] br-lan: port 3(wlan0) entered disabled state
[ 303.508411] device wlan1 left promiscuous mode
[ 303.513148] br-lan: port 2(wlan1) entered disabled state
Thu Apr 28 13:00:06 2022 daemon.notice netifd: Interface 'lan' is now down
Thu Apr 28 13:00:06 2022 kern.info kernel: [ 303.085601] br-lan: port 3(wlan0) entered disabled state
Thu Apr 28 13:00:06 2022 kern.info kernel: [ 303.091237] br-lan: port 2(wlan1) entered disabled state
Thu Apr 28 13:00:06 2022 kern.info kernel: [ 303.096776] br-lan: port 1(eth0.1) entered disabled state
Thu Apr 28 13:00:06 2022 kern.info kernel: [ 303.224590] device eth0.1 left promiscuous mode
Thu Apr 28 13:00:06 2022 kern.info kernel: [ 303.229359] device eth0 left promiscuous mode
Thu Apr 28 13:00:06 2022 kern.info kernel: [ 303.234009] br-lan: port 1(eth0.1) entered disabled state
Thu Apr 28 13:00:06 2022 kern.info kernel: [ 303.348710] eth0: link down
Thu Apr 28 13:00:06 2022 kern.info kernel: [ 303.398410] device wlan0 left promiscuous mode
Thu Apr 28 13:00:06 2022 kern.info kernel: [ 303.403133] br-lan: port 3(wlan0) entered disabled state
Thu Apr 28 13:00:07 2022 kern.info kernel: [ 303.508411] device wlan1 left promiscuous mode
Thu Apr 28 13:00:07 2022 kern.info kernel: [ 303.513148] br-lan: port 2(wlan1) entered disabled state
Thu Apr 28 13:00:07 2022 daemon.info dnsmasq[1]: read /etc/hosts - 4 addresses
Thu Apr 28 13:00:07 2022 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 2 addresses
Thu Apr 28 13:00:07 2022 daemon.info dnsmasq[1]: read /tmp/hosts/odhcpd - 0 addresses
Thu Apr 28 13:00:07 2022 daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
Thu Apr 28 13:00:07 2022 daemon.notice netifd: Interface 'lan' is disabled
Thu Apr 28 13:00:07 2022 daemon.err odhcpd[2587]: setsockopt(IPV6_ADD_MEMBERSHIP): No such device
Thu Apr 28 13:00:07 2022 daemon.err odhcpd[2587]: setsockopt(SO_BINDTODEVICE): No such device
Thu Apr 28 13:00:07 2022 daemon.notice netifd: VLAN 'eth0.1' link is down
Thu Apr 28 13:00:07 2022 daemon.notice netifd: bridge 'br-lan' link is down
Thu Apr 28 13:00:07 2022 daemon.notice netifd: Interface 'lan' has link connectivity loss
Thu Apr 28 13:00:07 2022 daemon.notice netifd: Network device 'eth0' link is down
Thu Apr 28 13:00:07 2022 daemon.notice netifd: Interface 'loopback' is now down
Thu Apr 28 13:00:07 2022 daemon.notice netifd: Interface 'loopback' is disabled
Thu Apr 28 13:00:07 2022 daemon.err odhcpd[2587]: setsockopt(SO_BINDTODEVICE): No such device
Thu Apr 28 13:00:07 2022 daemon.err odhcpd[2587]: setsockopt(SO_BINDTODEVICE): No such device
Thu Apr 28 13:00:07 2022 daemon.notice netifd: Network device 'lo' link is down
Thu Apr 28 13:00:07 2022 daemon.notice netifd: Interface 'loopback' has link connectivity loss
[ 304.631887] ath10k_pci 0000:00:00.0: mac flush null vif, drop 0 queues 0xffff
[ 304.688785] ath10k_pci 0000:00:00.0: peer-unmap-event: unknown peer id 0
[ 304.695725] ath10k_pci 0000:00:00.0: peer-unmap-event: unknown peer id 0
Thu Apr 28 13:00:07 2022 daemon.notice hostapd: Remove interface 'wlan1'
Thu Apr 28 13:00:07 2022 daemon.notice hostapd: wlan1: interface state ENABLED->DISABLED
Thu Apr 28 13:00:07 2022 daemon.notice hostapd: wlan1: AP-DISABLED
Thu Apr 28 13:00:07 2022 daemon.notice hostapd: wlan1: CTRL-EVENT-TERMINATING
Thu Apr 28 13:00:07 2022 daemon.err hostapd: rmdir[ctrl_interface=/var/run/hostapd]: Permission denied
Thu Apr 28 13:00:07 2022 daemon.notice hostapd: nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Thu Apr 28 13:00:07 2022 daemon.notice hostapd: nl80211: Failed to remove interface wlan1 from bridge br-lan: No such device
Thu Apr 28 13:00:07 2022 daemon.notice netifd: Network device 'wlan1' link is down
Thu Apr 28 13:00:07 2022 daemon.err collectd[2801]: Exiting normally.
Thu Apr 28 13:00:07 2022 daemon.notice hostapd: Remove interface 'wlan0'
Thu Apr 28 13:00:07 2022 daemon.notice hostapd: wlan0: interface state ENABLED->DISABLED
Thu Apr 28 13:00:07 2022 daemon.notice hostapd: wlan0: AP-DISABLED
Thu Apr 28 13:00:07 2022 daemon.notice hostapd: wlan0: CTRL-EVENT-TERMINATING
Thu Apr 28 13:00:07 2022 daemon.err hostapd: rmdir[ctrl_interface=/var/run/hostapd]: Permission denied
Thu Apr 28 13:00:07 2022 daemon.notice hostapd: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Thu Apr 28 13:00:07 2022 daemon.notice netifd: Interface 'wg0' is now down
Thu Apr 28 13:00:07 2022 daemon.err odhcpd[2587]: setsockopt(SO_BINDTODEVICE): No such device
Thu Apr 28 13:00:07 2022 daemon.err odhcpd[2587]: setsockopt(SO_BINDTODEVICE): No such device
Thu Apr 28 13:00:08 2022 daemon.notice netifd: Wireless device 'radio1' is now down
Thu Apr 28 13:00:08 2022 daemon.notice hostapd: nl80211: Failed to remove interface wlan0 from bridge br-lan: No such device
Thu Apr 28 13:00:08 2022 kern.info kernel: [ 304.631887] ath10k_pci 0000:00:00.0: mac flush null vif, drop 0 queues 0xffff
Thu Apr 28 13:00:08 2022 kern.warn kernel: [ 304.688785] ath10k_pci 0000:00:00.0: peer-unmap-event: unknown peer id 0
Thu Apr 28 13:00:08 2022 kern.warn kernel: [ 304.695725] ath10k_pci 0000:00:00.0: peer-unmap-event: unknown peer id 0
Thu Apr 28 13:00:08 2022 daemon.notice netifd: Interface 'wan' is now down
Thu Apr 28 13:00:08 2022 daemon.notice netifd: Network device 'wlan0' link is down
Thu Apr 28 13:00:08 2022 daemon.err odhcpd[2587]: Failed to send to ff02::1%lan@br-lan (Bad file descriptor)
Thu Apr 28 13:00:10 2022 user.notice : Added device handler type: bonding
Thu Apr 28 13:00:10 2022 user.notice : Added device handler type: 8021ad
Thu Apr 28 13:00:10 2022 user.notice : Added device handler type: 8021q
Thu Apr 28 13:00:10 2022 user.notice : Added device handler type: macvlan
Thu Apr 28 13:00:10 2022 user.notice : Added device handler type: veth
Thu Apr 28 13:00:10 2022 user.notice : Added device handler type: bridge
Thu Apr 28 13:00:10 2022 user.notice : Added device handler type: Network device
Thu Apr 28 13:00:10 2022 user.notice : Added device handler type: tunnel
Thu Apr 28 13:00:10 2022 daemon.err hostapd: rmdir[ctrl_interface=/var/run/hostapd]: Permission denied
Thu Apr 28 13:00:10 2022 daemon.info dnsmasq[1]: exiting on receipt of SIGTERM
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: started, version 2.86 cachesize 150
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: DNS service limited to local subnets
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: compile time options: IPv6 GNU-getopt no-DBus UBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-cryptohash no-DNSSEC no-ID loop-detect inotify dumpfile
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: UBus support enabled: connected to system bus
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: using only locally-known addresses for test
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: using only locally-known addresses for onion
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: using only locally-known addresses for localhost
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: using only locally-known addresses for local
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: using only locally-known addresses for invalid
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: using only locally-known addresses for bind
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: using only locally-known addresses for lan
Thu Apr 28 13:00:11 2022 daemon.warn dnsmasq[1]: no servers found in /tmp/resolv.conf.d/resolv.conf.auto, will retry
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: read /etc/hosts - 4 addresses
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 0 addresses
Thu Apr 28 13:00:11 2022 daemon.info dnsmasq[1]: read /tmp/hosts/odhcpd - 0 addresses
Thu Apr 28 13:00:11 2022 authpriv.info dropbear[2202]: Early exit: Terminated by signal
Terminated
root@ROD:/# [ 310.608598] eth0: link up (1000Mbps/Full duplex)
[ 310.615229] br-lan: port 1(eth0.1) entered blocking state
[ 310.620855] br-lan: port 1(eth0.1) entered disabled state
[ 310.626677] device eth0.1 entered promiscuous mode
[ 310.631668] device eth0 entered promiscuous mode
[ 310.637750] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 310.645224] device eth0 left promiscuous mode
[ 310.650957] device eth0.1 left promiscuous mode
[ 310.655655] br-lan: port 1(eth0.1) entered disabled state
[ 310.662498] eth0: link down
[ 310.946974] eth0: link up (1000Mbps/Full duplex)
[ 310.953839] br-lan: port 1(eth0.1) entered blocking state
[ 310.959477] br-lan: port 1(eth0.1) entered disabled state
[ 310.965301] device eth0.1 entered promiscuous mode
[ 310.970292] device eth0 entered promiscuous mode
[ 310.997338] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 311.060651] device eth0 left promiscuous mode
[ 311.092590] device eth0.1 left promiscuous mode
[ 311.097285] br-lan: port 1(eth0.1) entered disabled state
[ 311.146386] eth0: link down
[ 313.298167] reboot: Restarting system
▒
U-Boot 1.1.4 (May 11 2021 - 11:30:30)
ap152 - Dragonfly 1.0DRAM:
ZTE MF 286D OpenWrt 23.05-SNAPSHOT r23484-b742216dc8
Zyxel EX5601-T0 ubootmod OpenWrt 24.10-SNAPSHOT, r28432-7609571dcd
TP-LINK Archer C7 v5 - 1.14.0.2 (Built 20231226-1035 git@8e210b77)