https://github.com/slice/netwatch
A Lua script that watches your network and restarts it when it doesn't work. Linux only.
https://github.com/slice/netwatch
moonscript ping
Last synced: 11 months ago
JSON representation
A Lua script that watches your network and restarts it when it doesn't work. Linux only.
- Host: GitHub
- URL: https://github.com/slice/netwatch
- Owner: slice
- Created: 2016-12-30T14:34:48.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-30T15:14:55.000Z (about 9 years ago)
- Last Synced: 2025-01-21T16:23:59.811Z (about 1 year ago)
- Topics: moonscript, ping
- Language: MoonScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `netwatch`
netwatch watches your network using `nmcli` (`networkmanager`) and restarts it
if something goes wrong.
## how it works
nw opens a ping process, and monitors the time it takes to ping your ping
address (default: `8.8.8.8`). it also detects if the network is unreachable.
if the network becomes to slow or the network becomes unreachable, it is
revived.
### network revival
1. network is restarted
2. wait until connectivity to the network
3. wait for internet connection (using ping)
4. restrt ping, monitor your network
## compiling
### prerequisites
- lua 5.3 (untested with other versions)
- luarocks
- moonscript
- luasocket (sleep)
use moonscript to compile `nw.moon`
## notification support
`notify-send` will be used to send you notifications when your network is being
revived or it has been revived. you will only see these notifications if your
notification daemon is running.