Add new ping_template command
This commit is contained in:
parent
c6bd010680
commit
021ab18f68
3 changed files with 17 additions and 31 deletions
20
ping_alive
20
ping_alive
|
@ -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
|
|
||||||
|
|
11
ping_pong.sh
11
ping_pong.sh
|
@ -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
17
ping_template.sh
Executable 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
|
Loading…
Add table
Reference in a new issue