diff --git a/rootfs/scripts/aussieadsb.sh b/aussieadsb.sh similarity index 95% rename from rootfs/scripts/aussieadsb.sh rename to aussieadsb.sh index d056b58..bd5b27f 100755 --- a/rootfs/scripts/aussieadsb.sh +++ b/aussieadsb.sh @@ -1,4 +1,4 @@ -#!/command/with-contenv bash +#!/bin/bash # shellcheck shell=bash disable=SC2015,SC2162 # @@ -41,6 +41,20 @@ fi AUSSIEADSB_KEY="${AUSSIEADSB_KEY:-$2}" +if ! which jq >/dev/null 2>&1; then + echo "For registration to work, we need to do a one-time installation of JQ to your system" + echo "Please be patient..." + + if (( UID == 0 )); then + apt-get update -qq + apt-get install -o Dpkg::Options::="--force-confnew" -y --no-install-recommends -qq jq + else + sudo apt-get update -qq + sudo apt-get install -o Dpkg::Options::="--force-confnew" -y --no-install-recommends -qq jq + fi +fi + + case "${1,,}" in "-register") if [[ -n "$AUSSIEADSB_KEY" ]]; then