change this function to be more generic and taken in server name as an argument instead of a environment variable

This commit is contained in:
Ray Tanaka
2018-10-30 18:05:35 -07:00
parent bb9347b115
commit 7c3a5f4b94
2 changed files with 3 additions and 3 deletions

3
run/lookup-ip-address.sh Normal file
View File

@@ -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 '()')"