commit: 5d7197e82bf2a500fda602f0fb31f494e3a3ed32
parent: 913cd054a5664bb37b4aaf8aea339e21b346a415
Author: Emma Brooks <me@pluvano.com>
Date: Sat, 9 May 2020 06:23:15 +0000
Remove bashisms
ap-fetch.sh is shebanged as /bin/sh, however on systems where /bin/sh
isn't a symlink to bash, the script will fail as it uses [[.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ap-fetch.sh b/ap-fetch.sh
@@ -9,14 +9,14 @@ die() {
exit 1
}
-if [[ -z "$@" ]]
+if [ -z "$@" ]
then
die "Usage: ${0} [curl options] <url>"
fi
curl -sSL -H "${accept_header}" -I $@ | tee /dev/stderr | grep -q -i -e '^Content-Type: application/.*json'
-if [[ "$?" != 0 ]]
+if [ "$?" != 0 ]
then
die "Doesn’t have “Content-Type: application/.*json” in the headers"
fi