From 05ddb4ca9571d98e885b8a869ce9adf409ff21a0 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 5 Jul 2023 10:52:53 -0400 Subject: Set env to bash and echo escaped chars SH doesn't have source apparently and I missed a -e --- update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update.sh b/update.sh index 9fba7be..663cebc 100755 --- a/update.sh +++ b/update.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash set -e if [ $# -ne 2 ]; then echo "Usage: ./update.sh DOMAIN API_CONFIG" >&2 @@ -18,7 +18,7 @@ if [ "$config_ip" != "$actual_ip" ]; then -d "{ \"secretapikey\": \"${SECRETAPIKEY}\", \"apikey\": \"${APIKEY}\" }") status=$(echo "$res" | jq -r '.status') if [ "$status" != "SUCCESS" ]; then - echo "Failed to fetch domain ID:\n\t$res" >&2 + echo -e "Failed to fetch domain ID:\n\t$res" >&2 exit 1 fi ID=$(echo "$res" | jq -r ".records[] | select(.type == \"A\") | select(.content == \"${config_ip}\") | .id") -- cgit v1.2.3-54-g00ecf