summaryrefslogtreecommitdiff
path: root/get_ip_addr.sh
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2025-12-15 13:41:01 +0000
committerJoe Carstairs <me@joeac.net>2025-12-15 13:41:01 +0000
commit00dfd4bc0274070d9bc979593d5aab7cd97b9fc3 (patch)
treebdc3bb04e76f89275ff2637d004ea774f172e559 /get_ip_addr.sh
parent6722b2b23ec6e69181714b52d4a95667127ea5f2 (diff)
fixes
Diffstat (limited to 'get_ip_addr.sh')
-rwxr-xr-xget_ip_addr.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/get_ip_addr.sh b/get_ip_addr.sh
index 27c948a..057fcd0 100755
--- a/get_ip_addr.sh
+++ b/get_ip_addr.sh
@@ -2,7 +2,7 @@
ip_version="$1"
if [ -z "${ip_version:-}" ] || ([ "$ip_version" != 4 ] && [ "$ip_version" != 6 ]); then
- echo "Usage: get_ip_addr <4|6>" &>2
+ echo "Usage: get_ip_addr <4|6>" >&2
exit 1
fi
@@ -15,13 +15,13 @@ set -eu
CONN_NAME=${CONN_NAME:-nevis}
conn_device_name="$(nmcli --fields NAME,DEVICE con show | grep ^$CONN_NAME | sed 's/\s\+/ /g' | cut -d' ' -f 2)"
if [ -z "${conn_device_name:-}" ]; then
- echo "Could not find the connection device name for connection: \"$CONN_NAME\"" &>2
+ echo "Could not find the connection device name for connection: \"$CONN_NAME\"" >&2
exit 1
fi
device_line_no="$(ip addr | grep -En ^[0-9]+:\ $conn_device_name | cut -d':' -f 1)"
if [ -z "${device_line_no:-}" ]; then
- echo "Could not find device: \"$conn_device_name\" in output of ip addr" &>2
+ echo "Could not find device: \"$conn_device_name\" in output of ip addr" >&2
exit 1
fi