mirror of
https://github.com/Stunkymonkey/dotfiles.git
synced 2025-05-25 19:14:39 +02:00
initial commit
This commit is contained in:
commit
86a1da2632
35 changed files with 1162 additions and 0 deletions
21
bin/host-is-on.sh
Executable file
21
bin/host-is-on.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "No host given!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# repeat a notification if the host is not online after this amount of seconds yet
|
||||
waiting=30
|
||||
|
||||
count=0
|
||||
while ! ping -W 1 -w 1 -c 1 $1 2>&1 >/dev/null; do
|
||||
sleep 1
|
||||
count=$(( $count + 1))
|
||||
if [ $count -gt $waiting ]; then
|
||||
count=0
|
||||
notify-send -i network-transmit "Host wait" "Still waiting for host '$1'."
|
||||
fi
|
||||
done
|
||||
|
||||
notify-send -i network-transmit-receive "Host online!" "Host '$1' is now online!!!"
|
Loading…
Add table
Add a link
Reference in a new issue