A bash ping script with some extra features including:
- Colored output for up / down ping responses
- Log files are saved with date & time stamps inside nested folders by date
- Log files are dynamically generated, so if the ongoing ping rolls over into a new day, the target log file changes automatically
Set the script as executable
chmod +x pn.sh
Edit the script (if desired) to change where ping logs are stored
logdir_base=~/ping_logs
Add symbolic link to your PATH (optional but recommended)
ln -s ~/location/of/pn.sh ~/.local/bin/pn
Host is required
pn [host] [packet size]
Ping github with standard packets
pn github.com
Ping slashdot with large packets
pn slashdot.org 1500
Ping google dns
pn 8.8.8.8