From 7c3a5f4b94e175acf851be09dabc181cfb99bff3 Mon Sep 17 00:00:00 2001 From: Ray Tanaka Date: Tue, 30 Oct 2018 18:05:35 -0700 Subject: [PATCH] change this function to be more generic and taken in server name as an argument instead of a environment variable --- run/get-archiveserver-ip-address.sh | 3 --- run/lookup-ip-address.sh | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 run/get-archiveserver-ip-address.sh create mode 100644 run/lookup-ip-address.sh diff --git a/run/get-archiveserver-ip-address.sh b/run/get-archiveserver-ip-address.sh deleted file mode 100644 index 8a3936e..0000000 --- a/run/get-archiveserver-ip-address.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -eu - -echo "$(ping -c 1 -w 1 $archiveserver 2>/dev/null | head -n 1 | grep -o -e "(\([[:digit:]]\{1,3\}\.\)\{3\}[[:digit:]]\{1,3\})" | tr -d '()')" \ No newline at end of file diff --git a/run/lookup-ip-address.sh b/run/lookup-ip-address.sh new file mode 100644 index 0000000..41b8f5a --- /dev/null +++ b/run/lookup-ip-address.sh @@ -0,0 +1,3 @@ +#!/bin/bash -eu + +echo "$(ping -c 1 -w 1 $1 2>/dev/null | head -n 1 | grep -o -e "(\([[:digit:]]\{1,3\}\.\)\{3\}[[:digit:]]\{1,3\})" | tr -d '()')" \ No newline at end of file