From 021ab18f683688ee8b9ca3046d2686aa49c5b977 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 13 Feb 2023 17:24:47 +0100 Subject: [PATCH] Add new ping_template command --- ping_alive | 20 -------------------- ping_pong.sh | 11 ----------- ping_template.sh | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 31 deletions(-) delete mode 100755 ping_alive delete mode 100644 ping_pong.sh create mode 100755 ping_template.sh diff --git a/ping_alive b/ping_alive deleted file mode 100755 index a3e337a..0000000 --- a/ping_alive +++ /dev/null @@ -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 - diff --git a/ping_pong.sh b/ping_pong.sh deleted file mode 100644 index e93917c..0000000 --- a/ping_pong.sh +++ /dev/null @@ -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 diff --git a/ping_template.sh b/ping_template.sh new file mode 100755 index 0000000..989f6f9 --- /dev/null +++ b/ping_template.sh @@ -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