Improved install scripts

Due to unforeseen events :/
This commit is contained in:
Geoffrey Frogeye 2020-01-05 15:06:23 +01:00
parent 8ec06d3618
commit 73cbcbb3f5
9 changed files with 176 additions and 96 deletions

View file

@ -50,12 +50,17 @@ urldecode() { # string
function _machines-api {
route=$1
shift
wget "$MACHINES_API/$route" --content-on-error --quiet --output-document=- "$@"
temp=$(mktemp)
wget "$MACHINES_API/$route" --content-on-error --quiet --output-document=$temp "$@"
result=$?
if [ $result != 0 ]; then
echo "[ERROR] wget returned $result for route $route" 1>&2;
cat $temp 1>&2;
rm $temp
exit 2
fi
cat $temp
rm $temp
}
function _machines-apiToken {