Add new ping_template command

This commit is contained in:
Nico Schottelius 2023-02-13 17:24:47 +01:00
parent c6bd010680
commit 021ab18f68
3 changed files with 17 additions and 31 deletions

View File

@ -1,20 +0,0 @@
#!/bin/sh
HOST="192.168.0.1"
ret="true"
sleep="2"
count="2"
if [ -n "$1" ]; then HOST=$1;fi
while true; do
ping -c$count $HOST >/dev/null 2>/dev/null || ret=failed
if [ $ret = "failed" ]; then
echo "Failed: "`date`
else
echo "Recieved: "`date`
fi
sleep $sleep
done

View File

@ -1,11 +0,0 @@
HOSTS="www.spiegel.de www.lernen.de www.isc.org B.ROOT-SERVERS.NET"
STATUS=offline
for myh in $HOSTS; do
ping -c1 $myh >/dev/null 2>&1 && STATUS=online
done
if [ "$STATUS" = offline ]; then
echo 'Offline.'`date`
fi

17
ping_template.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
case "$1" in
rm)
tmux new-session -s ping_rm -d ping 2a0f:98c0:1::2
tmux split-window -t ping_rm -h ping 2a0f:98c0:2::2
tmux split-window -t ping_rm -h ping 2a0f:98c0:9::2
tmux split-window -t ping_rm -v ping 2a0f:98c0:9::3
tmux select-pane -t ping_rm -L
tmux split-window -t ping_rm -v ping 2a0f:98c0:2::3
tmux select-pane -t ping_rm -L
tmux split-window -t ping_rm -v ping 2a0f:98c0:1::3
tmux attach -t ping_rm
;;
esac