diff --git a/.templates/00-banner.sh b/.templates/00-banner.sh index 33409469b..e62c33b9f 100644 --- a/.templates/00-banner.sh +++ b/.templates/00-banner.sh @@ -4,7 +4,6 @@ # ============================================================================== # Displays a simple add-on banner on startup # ============================================================================== -echo "hello" if bashio::supervisor.ping; then bashio::log.blue \ '-----------------------------------------------------------' diff --git a/enedisgateway2mqtt_dev/rootfs/etc/cont-init.d/99-run.sh b/enedisgateway2mqtt_dev/rootfs/etc/cont-init.d/99-run.sh index 29dd49554..c3f1c2c06 100644 --- a/enedisgateway2mqtt_dev/rootfs/etc/cont-init.d/99-run.sh +++ b/enedisgateway2mqtt_dev/rootfs/etc/cont-init.d/99-run.sh @@ -19,14 +19,14 @@ if [ -f /data/config.yaml ] && [ ! -L /data/config.yaml ]; then fi # Check if config file is there, or create one from template -if [ -f $CONFIGSOURCE ]; then +if [ -f "$CONFIGSOURCE" ]; then # Create symlink if not existing yet - [ ! -L /data/config.yaml ] && ln -sf $CONFIGSOURCE /data + [ ! -L /data/config.yaml ] && ln -sf "$CONFIGSOURCE" /data bashio::log.info "Using config file found in $CONFIGSOURCE" # Check if yaml is valid EXIT_CODE=0 - yamllint -d relaxed $CONFIGSOURCE &>ERROR || EXIT_CODE=$? + yamllint -d relaxed "$CONFIGSOURCE" &>ERROR || EXIT_CODE=$? if [ $EXIT_CODE = 0 ]; then echo "Config file is a valid yaml" else @@ -37,10 +37,10 @@ if [ -f $CONFIGSOURCE ]; then else # Create symlink for addon to create config touch ${CONFIGSOURCE} - ln -sf $CONFIGSOURCE /data + ln -sf "$CONFIGSOURCE" /data rm $CONFIGSOURCE # Need to restart - bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting." + bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in "$CONFIGSOURCE" before restarting." fi # Remove previous link or file diff --git a/fireflyiii_data_importer/rootfs/etc/cont-init.d/20-folders.sh b/fireflyiii_data_importer/rootfs/etc/cont-init.d/20-folders.sh index 4e144d1dd..5145bd129 100644 --- a/fireflyiii_data_importer/rootfs/etc/cont-init.d/20-folders.sh +++ b/fireflyiii_data_importer/rootfs/etc/cont-init.d/20-folders.sh @@ -9,4 +9,4 @@ mkdir -p "$CONFIGSOURCE/import_files" || true mkdir -p "$CONFIGSOURCE/configurations" || true # Make sure permissions are right -chown -R $(id -u):$(id -g) "$CONFIGSOURCE" +chown -R "$(id -u):$(id -g)" "$CONFIGSOURCE" diff --git a/gazpar2mqtt/rootfs/etc/cont-init.d/90-config_yaml.sh b/gazpar2mqtt/rootfs/etc/cont-init.d/90-config_yaml.sh index f53d45e74..de758c579 100644 --- a/gazpar2mqtt/rootfs/etc/cont-init.d/90-config_yaml.sh +++ b/gazpar2mqtt/rootfs/etc/cont-init.d/90-config_yaml.sh @@ -10,7 +10,7 @@ CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION") chmod 755 $CONFIGSOURCE # Check if config file is there, or create one from template -if [ -f $CONFIGSOURCE ]; then +if [ -f "$CONFIGSOURCE" ]; then echo "Using config file found in $CONFIGSOURCE" else echo "No config file, creating one from template" @@ -26,13 +26,13 @@ else curl -L -f -s $TEMPLATESOURCE --output $CONFIGSOURCE fi # Need to restart - bashio::log.fatal "Config file not found, creating a new one. Please customize the file in $CONFIGSOURCE before restarting." + bashio::log.fatal "Config file not found, creating a new one. Please customize the file in "$CONFIGSOURCE" before restarting." # bashio::exit.nok fi # Check if yaml is valid EXIT_CODE=0 -yamllint -d relaxed $CONFIGSOURCE &>ERROR || EXIT_CODE=$? +yamllint -d relaxed "$CONFIGSOURCE" &>ERROR || EXIT_CODE=$? if [ $EXIT_CODE = 0 ]; then echo "Config file is a valid yaml" else diff --git a/joal/Dockerfile b/joal/Dockerfile index db4cf0929..e13611bc5 100644 --- a/joal/Dockerfile +++ b/joal/Dockerfile @@ -31,7 +31,7 @@ RUN \ && curl -s -S -J -L -o /tmp/joal.tar.gz $(curl -s https://api.github.com/repos/anthonyraymond/joal/releases/latest | grep -o "http.*joal.tar.gz") >/dev/null \ && mkdir -p /data/joal \ && tar zxvf /tmp/joal.tar.gz -C /data/joal >/dev/null \ - && chown -R $(id -u):$(id -g) /data/joal \ + && chown -R "$(id -u):$(id -g)" /data/joal \ && rm /data/joal/jack-of* || true ################## diff --git a/joal/rootfs/etc/cont-init.d/99-run.sh b/joal/rootfs/etc/cont-init.d/99-run.sh index 2fa95b25a..45e04158d 100644 --- a/joal/rootfs/etc/cont-init.d/99-run.sh +++ b/joal/rootfs/etc/cont-init.d/99-run.sh @@ -16,14 +16,14 @@ fi # download latest version -if [ $VERBOSE = true ]; then +if [ "$VERBOSE" = true ]; then curl -J -L -o /tmp/joal.tar.gz $(curl -s https://api.github.com/repos/anthonyraymond/joal/releases/latest | grep -o "http.*joal.tar.gz") else curl -s -S -J -L -o /tmp/joal.tar.gz $(curl -s https://api.github.com/repos/anthonyraymond/joal/releases/latest | grep -o "http.*joal.tar.gz") >/dev/null fi mkdir -p /data/joal tar zxvf /tmp/joal.tar.gz -C /data/joal >/dev/null -chown -R $(id -u):$(id -g) /data/joal +chown -R "$(id -u):$(id -g)" /data/joal rm /data/joal/jack-of* bashio::log.info "Joal updated" @@ -84,7 +84,7 @@ mkdir -p /var/log/nginx && touch /var/log/nginx/error.log # LAUNCH APPS # ############### -if [ $VERBOSE = true ]; then +if [ "$VERBOSE" = true ]; then nohup java -jar /joal/joal.jar --joal-conf=/data/joal --spring.main.web-environment=true --server.port="8081" --joal.ui.path.prefix=${UIPATH} --joal.ui.secret-token=$TOKEN else nohup java -jar /joal/joal.jar --joal-conf=/data/joal --spring.main.web-environment=true --server.port="8081" --joal.ui.path.prefix=${UIPATH} --joal.ui.secret-token=$TOKEN >/dev/null diff --git a/papermerge/rootfs/etc/cont-init.d/00-folders.sh b/papermerge/rootfs/etc/cont-init.d/00-folders.sh index fb0956277..56d26fd77 100644 --- a/papermerge/rootfs/etc/cont-init.d/00-folders.sh +++ b/papermerge/rootfs/etc/cont-init.d/00-folders.sh @@ -17,4 +17,4 @@ if [ -d /data/config ]; then fi # Make sure permissions are right -chown -R $(id -u):$(id -g) $CONFIGLOCATION +chown -R "$(id -u):$(id -g)" $CONFIGLOCATION diff --git a/transmission/rootfs/etc/cont-init.d/19-json_repair.sh b/transmission/rootfs/etc/cont-init.d/19-json_repair.sh index 1c86b4a3a..e6ed80a4d 100644 --- a/transmission/rootfs/etc/cont-init.d/19-json_repair.sh +++ b/transmission/rootfs/etc/cont-init.d/19-json_repair.sh @@ -5,39 +5,39 @@ JSONTOCHECK='/config/transmission/settings.json' JSONSOURCE='/defaults/settings.json' # If json already exists -if [ -f ${JSONTOCHECK} ]; then +if [ -f "${JSONTOCHECK}" ]; then # Variables echo "Checking settings.json format" # Check if json file valid or not - jq . -S ${JSONTOCHECK} &>/dev/null && ERROR=false || ERROR=true + jq . -S "${JSONTOCHECK}" &>/dev/null && ERROR=false || ERROR=true if [ $ERROR = true ]; then bashio::log.fatal "Settings.json structure is abnormal, restoring options from scratch. Your old file is renamed as settings.json_old" - mv ${JSONSOURCE} ${JSONSOURCE}_old - cp ${JSONSOURCE} ${JSONTOCHECK} + mv "${JSONSOURCE}" "${JSONSOURCE}"_old + cp "${JSONSOURCE}" "${JSONTOCHECK}" exit 0 fi # Get the default keys from the original file - mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE}) + mapfile -t arr < <(jq -r 'keys[]' "${JSONSOURCE}") # Check if all keys are still there, or add them - # spellcheck disable=SC2068 + # shellcheck disable=SC2086 for KEYS in "${arr[@]}"; do # Check if key exists - KEYSTHERE=$(jq "has(\"${KEYS}\")" ${JSONTOCHECK}) + KEYSTHERE=$(jq "has(\"${KEYS}\")" "${JSONTOCHECK}") if [ "$KEYSTHERE" != "true" ]; then #Fetch initial value - JSONSOURCEVALUE=$(jq -r ".\"$KEYS\"" ${JSONSOURCE}) + JSONSOURCEVALUE=$(jq -r ".\"$KEYS\"" "${JSONSOURCE}") #Add key - sed -i "3 i\"${KEYS}\": \"${JSONSOURCEVALUE}\"," ${JSONTOCHECK} + sed -i "3 i\"${KEYS}\": \"${JSONSOURCEVALUE}\"," "${JSONTOCHECK}" # Message bashio::log.warning "${KEYS} was missing from your settings.json, it was added with the default value ${JSONSOURCEVALUE}" fi done # Show structure in a nice way - jq . -S ${JSONTOCHECK} | cat >temp.json && mv temp.json ${JSONTOCHECK} + jq . -S "${JSONTOCHECK}" | cat >temp.json && mv temp.json "${JSONTOCHECK}" # Message bashio::log.info "Your settings.json was checked and seems perfectly normal!"