summaryrefslogtreecommitdiff
path: root/home/xyz/.local/bin/pa
blob: 86ae4e50912a7129d0394aa0463d2e044e5929c9 (plain)
1
2
3
4
5
6
7
8
#!/bin/sh
# Ping Alarm

while ! ping -w5 "$1"; do
	sleep 5
done
notify-send "$1 on"
bell
pan>t:T: opt; do case $opt in c) tz_from="Asia/Shanghai";; f) tz_from="$(tzselect)";; F) tz_from="$OPTARG";; # one extra ',' at the end will not let `for tz in ...` loop one extra time? t) for i in $(seq "$OPTARG"); do tz_to="$(tzselect),$tz_to" done;; T) tz_to="$OPTARG,$tz_to";; \?) exit 1;; esac done shift $((OPTIND-1))