From a22ce94a4653e7f6a6b2fafa000ab8073e5a828a Mon Sep 17 00:00:00 2001 From: Alexandre Date: Mon, 17 Jan 2022 13:18:05 +0100 Subject: [PATCH] hadolint --- .templates/00-banner.sh | 1 + .templates/00-global_var.sh | 3 +- .templates/19-json_repair.sh | 1 + .templates/90-config_yaml.sh | 1 + .templates/90-dns_set.sh | 30 +++++++-------- .templates/91-silent.sh | 9 +++-- .templates/92-local_mounts.sh | 1 + .templates/92-smb_mounts.sh | 1 + .../rootfs/etc/cont-init.d/99-run.sh | 31 ++++++++-------- bitwarden/rootfs/etc/cont-init.d/nginx.sh | 1 + bitwarden/rootfs/etc/services.d/bitwarden/run | 37 ++++++++++--------- bitwarden/rootfs/etc/services.d/nginx/run | 1 + emby/rootfs/etc/cont-init.d/91-silent.sh | 7 ++-- .../etc/cont-init.d/91-mqtt_autodiscover.sh | 1 + .../rootfs/etc/cont-init.d/20-folders.sh | 1 + flexget/rootfs/etc/cont-init.d/00-folders.sh | 1 + .../etc/cont-init.d/89-mqtt_autodiscover.sh | 1 + grav/rootfs/etc/cont-init.d/00-ha-env.sh | 3 +- grav/rootfs/etc/cont-init.d/20-folders.sh | 8 ++-- lidarr/rootfs/etc/cont-init.d/20-folders.sh | 1 + nextcloud/rootfs/defaults/nextcloud-perms.sh | 7 ++-- .../rootfs/etc/cont-init.d/10-adduser.sh | 1 + nextcloud/rootfs/etc/cont-init.d/30-keygen.sh | 3 +- nextcloud/rootfs/etc/cont-init.d/40-config.sh | 11 +++--- .../rootfs/etc/cont-init.d/60-memcache.sh | 3 +- .../etc/cont-init.d/99-elasticsearch.sh | 1 + .../etc/cont-init.d/99-mariadb_discovery.sh | 1 + nextcloud/rootfs/etc/cont-init.d/99-ocr.sh | 17 +++++---- .../etc/cont-init.d/99-trusted_domains.sh | 15 ++++---- nzbget/rootfs/etc/cont-init.d/20-folders.sh | 16 ++++---- ombi/rootfs/etc/cont-init.d/20-folders.sh | 16 ++++---- organizr/rootfs/etc/cont-init.d/00-folders.sh | 1 + .../rootfs/etc/cont-init.d/20-folders.sh | 16 ++++---- .../rootfs/etc/cont-init.d/91-pikepdf.sh | 17 +++++---- .../rootfs/etc/cont-init.d/93-multiocr.sh | 3 +- papermerge/rootfs/etc/cont-init.d/91-OCR.sh | 1 + .../etc/cont-init.d/99-configuration.sh | 33 ++++++++--------- piwigo/rootfs/etc/cont-init.d/41-folders.sh | 1 + plex/rootfs/etc/cont-init.d/21-folders.sh | 1 + .../cont-init.d/00-aaa_portainer_install.sh | 13 ++++--- portainer/rootfs/etc/cont-init.d/30-nginx.sh | 22 +++++------ portainer/rootfs/etc/cont-init.d/portainer.sh | 1 + portainer/rootfs/etc/services.d/nginx/run | 1 + .../rootfs/etc/cont-init.d/30-nginx.sh | 16 ++++---- .../91-qbittorrent_configuration.sh | 3 +- .../rootfs/etc/cont-init.d/93-openvpn.sh | 1 + .../rootfs/etc/openvpn/up-qbittorrent.sh | 1 + qbittorrent/rootfs/etc/services.d/nginx/run | 1 + .../rootfs/etc/services.d/qbittorrent/run | 1 + .../rootfs/etc/services.d/qbittorrent/timer | 11 ++++-- .../etc/cont-init.d/00-config_location.sh | 1 + scrutiny/rootfs/etc/cont-init.d/31-run.sh | 23 ++++++------ scrutiny/rootfs/etc/cont-init.d/32-nginx.sh | 1 + scrutiny/rootfs/etc/services.d/nginx/run | 1 + scrutiny/rootfs/run.sh | 4 +- .../rootfs/etc/cont-init.d/20-folders.sh | 1 + .../rootfs/etc/cont-init.d/99-run.sh | 11 +++--- .../rootfs/etc/cont-init.d/19-config.sh | 3 +- .../rootfs/etc/cont-init.d/19-json_repair.sh | 1 + ubooquity/rootfs/etc/32-nginx_ingress.sh | 3 +- .../rootfs/etc/cont-init.d/20-folders.sh | 16 ++++---- .../rootfs/etc/cont-init.d/32-nginx_ssl.sh | 1 + .../etc/cont-init.d/91-configuration.sh | 1 + .../rootfs/etc/cont-init.d/93-custom_webUI.sh | 1 + ubooquity/rootfs/etc/services.d/nginx/run | 1 + webtop/rootfs/etc/cont-init.d/20-folders.sh | 1 + webtop/rootfs/etc/cont-init.d/99-run.sh | 25 +++++++------ 67 files changed, 263 insertions(+), 207 deletions(-) diff --git a/.templates/00-banner.sh b/.templates/00-banner.sh index ccbd2159a..c35e4d388 100644 --- a/.templates/00-banner.sh +++ b/.templates/00-banner.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash # ============================================================================== # Displays a simple add-on banner on startup # ============================================================================== diff --git a/.templates/00-global_var.sh b/.templates/00-global_var.sh index 1fc09c0f3..7fa40be7f 100644 --- a/.templates/00-global_var.sh +++ b/.templates/00-global_var.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ################################### # Export all addon options as env # @@ -16,7 +17,7 @@ for KEYS in ${arr[@]}; do line="${KEYS}=${VALUE//[\"\']/}" # Use locally if ! bashio::config.false "verbose"; then bashio::log.blue "$line"; fi -# Export the variable to run scripts + # Export the variable to run scripts line="${KEYS}=${VALUE//[\"\']/} 2>/dev/null || true" [ -f /etc/services.d/*/*run* ] && sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null [ -f /etc/cont-init.d/*run* ] && sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null diff --git a/.templates/19-json_repair.sh b/.templates/19-json_repair.sh index 24dd1ac0e..bd9fcb787 100644 --- a/.templates/19-json_repair.sh +++ b/.templates/19-json_repair.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash JSONTOCHECK='/config/transmission/settings.json' JSONSOURCE='/defaults/settings.json' diff --git a/.templates/90-config_yaml.sh b/.templates/90-config_yaml.sh index 3049b5f48..2fdddf0b6 100644 --- a/.templates/90-config_yaml.sh +++ b/.templates/90-config_yaml.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ################## # INITIALIZATION # diff --git a/.templates/90-dns_set.sh b/.templates/90-dns_set.sh index dd80ef417..5e3291b4f 100644 --- a/.templates/90-dns_set.sh +++ b/.templates/90-dns_set.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ############### # DNS SETTING # @@ -7,22 +8,21 @@ # Avoid usage of local dns such as adguard home or pihole\n" if bashio::config.has_value 'DNS_server'; then - # Define variables - DNSSERVER=$(bashio::config 'DNS_server') - DNS="" - DNSLIST="" + # Define variables + DNSSERVER=$(bashio::config 'DNS_server') + DNS="" + DNSLIST="" - # Get DNS servers - for server in ${DNSSERVER//,/ } # Separate comma separated values - do - DNS="${DNS}nameserver $server\n" - DNSLIST="$server $DNSLIST" - done + # Get DNS servers + for server in ${DNSSERVER//,/ }; do # Separate comma separated values + DNS="${DNS}nameserver $server\n" + DNSLIST="$server $DNSLIST" + done - # Write resolv.conf - printf "${DNS}" > /etc/resolv.conf - chmod 644 /etc/resolv.conf - bashio::log.info "DNS SERVERS set to $DNSLIST" + # Write resolv.conf + printf "${DNS}" >/etc/resolv.conf + chmod 644 /etc/resolv.conf + bashio::log.info "DNS SERVERS set to $DNSLIST" else - bashio::log.info "DNS Servers option empty. Using default router (or HA) dns servers." + bashio::log.info "DNS Servers option empty. Using default router (or HA) dns servers." fi diff --git a/.templates/91-silent.sh b/.templates/91-silent.sh index 6cea84b94..c339926be 100644 --- a/.templates/91-silent.sh +++ b/.templates/91-silent.sh @@ -1,12 +1,13 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ############### # SILENT MODE # ############### if bashio::config.true 'silent'; then -APPEND=' > /dev/null' -[ -f /etc/services.d/*/run ] && sed -i '$s|$|'"$APPEND"'|' /etc/services.d/*/run -[ -f /etc/cont-init.d/*/*run* ] && sed -i '$s|$|'"$APPEND"'|' /etc/cont-init.d/*/*run* -bashio::log.info 'Silent mode activated, all logs from emby server are hidden. Disable this option if you need to troubleshoot the addon.' + APPEND=' > /dev/null' + [ -f /etc/services.d/*/run ] && sed -i '$s|$|'"$APPEND"'|' /etc/services.d/*/run + [ -f /etc/cont-init.d/*/*run* ] && sed -i '$s|$|'"$APPEND"'|' /etc/cont-init.d/*/*run* + bashio::log.info 'Silent mode activated, all logs from emby server are hidden. Disable this option if you need to troubleshoot the addon.' fi diff --git a/.templates/92-local_mounts.sh b/.templates/92-local_mounts.sh index 0920d68bd..e3f0182a0 100644 --- a/.templates/92-local_mounts.sh +++ b/.templates/92-local_mounts.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ###################### # MOUNT LOCAL SHARES # diff --git a/.templates/92-smb_mounts.sh b/.templates/92-smb_mounts.sh index 06410e554..9e976028c 100644 --- a/.templates/92-smb_mounts.sh +++ b/.templates/92-smb_mounts.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ######################### # MOUNT SMB SHARES v1.6 # diff --git a/addons_updater/rootfs/etc/cont-init.d/99-run.sh b/addons_updater/rootfs/etc/cont-init.d/99-run.sh index 2de0bced9..83848f333 100644 --- a/addons_updater/rootfs/etc/cont-init.d/99-run.sh +++ b/addons_updater/rootfs/etc/cont-init.d/99-run.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ########## # UPDATE # @@ -65,22 +66,22 @@ for addons in $(bashio::config "addon|keys"); do DOCKERHUB_REPO=$(echo "${UPSTREAM%%/*}") DOCKERHUB_IMAGE=$(echo $UPSTREAM | cut -d "/" -f2) LASTVERSION=$( - curl -L -s --fail "https://hub.docker.com/v2/repositories/${DOCKERHUB_REPO}/${DOCKERHUB_IMAGE}/tags/?page_size=1000" | \ - jq '.results | .[] | .name' -r | \ - sed -e '/.*latest.*/d' | \ - sed -e '/.*dev.*/d' | \ - sort -V | \ - tail -n 1 + curl -L -s --fail "https://hub.docker.com/v2/repositories/${DOCKERHUB_REPO}/${DOCKERHUB_IMAGE}/tags/?page_size=1000" | + jq '.results | .[] | .name' -r | + sed -e '/.*latest.*/d' | + sed -e '/.*dev.*/d' | + sort -V | + tail -n 1 ) - [ ${BETA} = true ] && \ - LASTVERSION=$( - curl -L -s --fail "https://hub.docker.com/v2/repositories/${DOCKERHUB_REPO}/${DOCKERHUB_IMAGE}/tags/?page_size=1000" | \ - jq '.results | .[] | .name' -r | \ - sed -e '/.*latest.*/d' | \ - sed -e '/.*dev.*/!d' | \ - sort -V | \ - tail -n 1 - ) + [ ${BETA} = true ] && + LASTVERSION=$( + curl -L -s --fail "https://hub.docker.com/v2/repositories/${DOCKERHUB_REPO}/${DOCKERHUB_IMAGE}/tags/?page_size=1000" | + jq '.results | .[] | .name' -r | + sed -e '/.*latest.*/d' | + sed -e '/.*dev.*/!d' | + sort -V | + tail -n 1 + ) else # Use github as upstream diff --git a/bitwarden/rootfs/etc/cont-init.d/nginx.sh b/bitwarden/rootfs/etc/cont-init.d/nginx.sh index e1d55fbe7..f0cc105dd 100644 --- a/bitwarden/rootfs/etc/cont-init.d/nginx.sh +++ b/bitwarden/rootfs/etc/cont-init.d/nginx.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash # ============================================================================== # Home Assistant Community Add-on: Bitwarden # This file configures nginx diff --git a/bitwarden/rootfs/etc/services.d/bitwarden/run b/bitwarden/rootfs/etc/services.d/bitwarden/run index c0d44c35b..a13705638 100644 --- a/bitwarden/rootfs/etc/services.d/bitwarden/run +++ b/bitwarden/rootfs/etc/services.d/bitwarden/run @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash # ============================================================================== # Home Assistant Community Add-on: Bitwarden # Runs the Vaultwarden server @@ -20,24 +21,24 @@ export ROCKET_SECRET_KEY="${secret_key}" # Find the matching log level if bashio::config.has_value 'log_level'; then case "$(bashio::string.lower "$(bashio::config 'log_level')")" in - all|trace) - log_level="trace" - ;; - debug) - log_level="debug" - ;; - info|notice) - log_level="info" - ;; - warning) - log_level="warn" - ;; - error|fatal) - log_level="error" - ;; - off) - log_level="off" - ;; + all | trace) + log_level="trace" + ;; + debug) + log_level="debug" + ;; + info | notice) + log_level="info" + ;; + warning) + log_level="warn" + ;; + error | fatal) + log_level="error" + ;; + off) + log_level="off" + ;; esac export LOG_LEVEL="${log_level}" diff --git a/bitwarden/rootfs/etc/services.d/nginx/run b/bitwarden/rootfs/etc/services.d/nginx/run index 9c29794d4..c9b0b9dc7 100644 --- a/bitwarden/rootfs/etc/services.d/nginx/run +++ b/bitwarden/rootfs/etc/services.d/nginx/run @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash # ============================================================================== # Home Assistant Community Add-on: Bitwarden # Runs the Nginx daemon diff --git a/emby/rootfs/etc/cont-init.d/91-silent.sh b/emby/rootfs/etc/cont-init.d/91-silent.sh index 1714f47de..74bc2dcca 100644 --- a/emby/rootfs/etc/cont-init.d/91-silent.sh +++ b/emby/rootfs/etc/cont-init.d/91-silent.sh @@ -1,11 +1,12 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ############### # SILENT MODE # ############### if bashio::config.true 'silent'; then -APPEND=' > /dev/null' -sed -i '$s|$|'"$APPEND"'|' /etc/services.d/*/run -bashio::log.info 'Silent mode activated, all logs from emby server are hidden. Disable this option if you need to troubleshoot the addon.' + APPEND=' > /dev/null' + sed -i '$s|$|'"$APPEND"'|' /etc/services.d/*/run + bashio::log.info 'Silent mode activated, all logs from emby server are hidden. Disable this option if you need to troubleshoot the addon.' fi diff --git a/enedisgateway2mqtt/rootfs/etc/cont-init.d/91-mqtt_autodiscover.sh b/enedisgateway2mqtt/rootfs/etc/cont-init.d/91-mqtt_autodiscover.sh index 6cc507a06..1fa3b8d4f 100644 --- a/enedisgateway2mqtt/rootfs/etc/cont-init.d/91-mqtt_autodiscover.sh +++ b/enedisgateway2mqtt/rootfs/etc/cont-init.d/91-mqtt_autodiscover.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ##################### # Autodiscover mqtt # diff --git a/filebrowser/rootfs/etc/cont-init.d/20-folders.sh b/filebrowser/rootfs/etc/cont-init.d/20-folders.sh index 418a66a1f..3fb69187e 100644 --- a/filebrowser/rootfs/etc/cont-init.d/20-folders.sh +++ b/filebrowser/rootfs/etc/cont-init.d/20-folders.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash if [ -d /config/filebrowser ]; then echo "Moving to new location /config/addons_config/filebrowser" diff --git a/flexget/rootfs/etc/cont-init.d/00-folders.sh b/flexget/rootfs/etc/cont-init.d/00-folders.sh index 7ee499d8b..71e0396fd 100644 --- a/flexget/rootfs/etc/cont-init.d/00-folders.sh +++ b/flexget/rootfs/etc/cont-init.d/00-folders.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash slug=flexget diff --git a/gazpar2mqtt/rootfs/etc/cont-init.d/89-mqtt_autodiscover.sh b/gazpar2mqtt/rootfs/etc/cont-init.d/89-mqtt_autodiscover.sh index 6cc507a06..1fa3b8d4f 100644 --- a/gazpar2mqtt/rootfs/etc/cont-init.d/89-mqtt_autodiscover.sh +++ b/gazpar2mqtt/rootfs/etc/cont-init.d/89-mqtt_autodiscover.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ##################### # Autodiscover mqtt # diff --git a/grav/rootfs/etc/cont-init.d/00-ha-env.sh b/grav/rootfs/etc/cont-init.d/00-ha-env.sh index 342068f41..3b412916e 100644 --- a/grav/rootfs/etc/cont-init.d/00-ha-env.sh +++ b/grav/rootfs/etc/cont-init.d/00-ha-env.sh @@ -1,5 +1,6 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do - printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k + printf "$(bashio::config $k)" >/var/run/s6/container_environment/$k done diff --git a/grav/rootfs/etc/cont-init.d/20-folders.sh b/grav/rootfs/etc/cont-init.d/20-folders.sh index 5cf2a6207..63d054585 100644 --- a/grav/rootfs/etc/cont-init.d/20-folders.sh +++ b/grav/rootfs/etc/cont-init.d/20-folders.sh @@ -1,12 +1,12 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash -echo "Updating folders..." +echo "Updating folders..." -for FOLDERS in "/share/grav" "/app/grav-admin/backup" -do +for FOLDERS in "/share/grav" "/app/grav-admin/backup"; do echo "... $FOLDERS" mkdir -p $FOLDERS chown -R abc:abc $FOLDERS done -bashio::log.warning "If error of missing folder when loading addon, just restart" +bashio::log.warning "If error of missing folder when loading addon, just restart" diff --git a/lidarr/rootfs/etc/cont-init.d/20-folders.sh b/lidarr/rootfs/etc/cont-init.d/20-folders.sh index ffeb8b530..51a7b1772 100644 --- a/lidarr/rootfs/etc/cont-init.d/20-folders.sh +++ b/lidarr/rootfs/etc/cont-init.d/20-folders.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash if [ ! -d /share/music ]; then echo "Creating /share/music" diff --git a/nextcloud/rootfs/defaults/nextcloud-perms.sh b/nextcloud/rootfs/defaults/nextcloud-perms.sh index 63ff70d55..1c4fa0ece 100644 --- a/nextcloud/rootfs/defaults/nextcloud-perms.sh +++ b/nextcloud/rootfs/defaults/nextcloud-perms.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ocpath="${NEXTCLOUD_PATH}" htuser='abc' @@ -44,13 +45,11 @@ chown -R ${htuser}:${htgroup} /ssl/nextcloud/keys || true chmod +x ${ocpath}/occ printf "chmod/chown .htaccess\n" -if [ -f ${ocpath}/.htaccess ] - then +if [ -f ${ocpath}/.htaccess ]; then chmod 0644 ${ocpath}/.htaccess chown ${rootuser}:${htgroup} ${ocpath}/.htaccess fi -if [ -f ${ocpath}/data/.htaccess ] - then +if [ -f ${ocpath}/data/.htaccess ]; then chmod 0644 ${ocpath}/data/.htaccess chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess fi diff --git a/nextcloud/rootfs/etc/cont-init.d/10-adduser.sh b/nextcloud/rootfs/etc/cont-init.d/10-adduser.sh index 36542b0ea..9d92806f4 100644 --- a/nextcloud/rootfs/etc/cont-init.d/10-adduser.sh +++ b/nextcloud/rootfs/etc/cont-init.d/10-adduser.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash PUID=$(bashio::config "PUID") PGID=$(bashio::config "PGID") diff --git a/nextcloud/rootfs/etc/cont-init.d/30-keygen.sh b/nextcloud/rootfs/etc/cont-init.d/30-keygen.sh index 464abffe6..6407eaa9a 100644 --- a/nextcloud/rootfs/etc/cont-init.d/30-keygen.sh +++ b/nextcloud/rootfs/etc/cont-init.d/30-keygen.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash if bashio::config.true 'use_own_certs'; then @@ -26,7 +27,7 @@ echo "... adding ssl certs in files" #Sets certificates for NGINXFILE in "/defaults/default" "/config/nginx/site-confs/default" "/data/config/nginx/site-confs/default"; do if [ -f $NGINXFILE ]; then - LINE=$(sed -n "/ssl_certificate /=" $NGINXFILE) + LINE=$(sed -n "/ssl_certificate /=" $NGINXFILE) if [ ! -z $LINE ]; then sed -i "/ssl_certificate/ d" $NGINXFILE sed -i "$LINE i ssl_certificate_key /ssl/$KEYFILE;" $NGINXFILE diff --git a/nextcloud/rootfs/etc/cont-init.d/40-config.sh b/nextcloud/rootfs/etc/cont-init.d/40-config.sh index 2fec5e302..dad12e107 100644 --- a/nextcloud/rootfs/etc/cont-init.d/40-config.sh +++ b/nextcloud/rootfs/etc/cont-init.d/40-config.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash #create folders datadirectory=$(bashio::config 'data_directory') @@ -6,17 +7,17 @@ mkdir -p \ $datadirectory \ /data/config/nextcloud/config \ /data/config/nextcloud/data \ - /data/config/www/nextcloud/config + /data/config/www/nextcloud/config #permissions chown abc:abc \ $datadirectory \ /data/config/nextcloud/config \ /data/config/nextcloud/data \ - /data/config/www/nextcloud/config - -chown -R abc:abc \ + /data/config/www/nextcloud/config + +chown -R abc:abc \ /var/lib/nginx - + rm -r /data/config/www/nextcloud/assets &>/dev/null chmod -R 777 /data/config diff --git a/nextcloud/rootfs/etc/cont-init.d/60-memcache.sh b/nextcloud/rootfs/etc/cont-init.d/60-memcache.sh index a1705a99b..279ef837d 100644 --- a/nextcloud/rootfs/etc/cont-init.d/60-memcache.sh +++ b/nextcloud/rootfs/etc/cont-init.d/60-memcache.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash # Change data directory datadirectory=$(bashio::config 'data_directory') @@ -6,7 +7,7 @@ bashio::log.info "Setting data diretory: ${datadirectory}" sed -i "s|%%datadirectory%%|$datadirectory|g" /defaults/config.php # copy config -[[ ! -f /data/config/www/nextcloud/config/config.php ]] && \ +[[ ! -f /data/config/www/nextcloud/config/config.php ]] && cp /defaults/config.php /data/config/www/nextcloud/config/config.php # permissions diff --git a/nextcloud/rootfs/etc/cont-init.d/99-elasticsearch.sh b/nextcloud/rootfs/etc/cont-init.d/99-elasticsearch.sh index b87d40798..f95f6b56c 100644 --- a/nextcloud/rootfs/etc/cont-init.d/99-elasticsearch.sh +++ b/nextcloud/rootfs/etc/cont-init.d/99-elasticsearch.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash LAUNCHER="sudo -u abc php /data/config/www/nextcloud/occ" || bashio::log.info "/data/config/www/nextcloud/occ not found" if ! bashio::fs.file_exists '/data/config/www/nextcloud/occ'; then diff --git a/nextcloud/rootfs/etc/cont-init.d/99-mariadb_discovery.sh b/nextcloud/rootfs/etc/cont-init.d/99-mariadb_discovery.sh index 2a66ddff5..c39aa5698 100644 --- a/nextcloud/rootfs/etc/cont-init.d/99-mariadb_discovery.sh +++ b/nextcloud/rootfs/etc/cont-init.d/99-mariadb_discovery.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash if bashio::services.available 'mysql'; then bashio::log.warning "MariaDB addon was found! It can't be configured automatically, but you can configure it manually using those values in the initial set-up :" diff --git a/nextcloud/rootfs/etc/cont-init.d/99-ocr.sh b/nextcloud/rootfs/etc/cont-init.d/99-ocr.sh index 262df3247..62ac025a8 100644 --- a/nextcloud/rootfs/etc/cont-init.d/99-ocr.sh +++ b/nextcloud/rootfs/etc/cont-init.d/99-ocr.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash LAUNCHER="sudo -u abc php /data/config/www/nextcloud/occ" || bashio::log.info "/data/config/www/nextcloud/occ not found" if ! bashio::fs.file_exists '/data/config/www/nextcloud/occ'; then @@ -27,14 +28,14 @@ if bashio::config.has_value 'OCR'; then if bashio::config.has_value 'OCRLANG'; then OCRLANG=$(bashio::config 'OCRLANG') for LANG in $(echo "$OCRLANG" | tr "," " "); do - if [ $LANG != "eng" ]; then - apk add --quiet --no-cache tesseract-ocr-data-$LANG || apk add --quiet --no-cache tesseract-ocr-data-$LANG@community - fi - bashio::log.info "OCR Language installed : $LANG" || bashio::log.fatal "Couldn't install OCR lang $LANG. Please check its format is conform" - # Downloading trainer data - cd /usr/share/tessdata - rm -r $LANG.traineddata &>/dev/null || true - wget https://github.com/tesseract-ocr/tessdata/raw/main/$LANG.traineddata &>/dev/null + if [ $LANG != "eng" ]; then + apk add --quiet --no-cache tesseract-ocr-data-$LANG || apk add --quiet --no-cache tesseract-ocr-data-$LANG@community + fi + bashio::log.info "OCR Language installed : $LANG" || bashio::log.fatal "Couldn't install OCR lang $LANG. Please check its format is conform" + # Downloading trainer data + cd /usr/share/tessdata + rm -r $LANG.traineddata &>/dev/null || true + wget https://github.com/tesseract-ocr/tessdata/raw/main/$LANG.traineddata &>/dev/null done fi elif $(bashio::config 'OCR') = false; then diff --git a/nextcloud/rootfs/etc/cont-init.d/99-trusted_domains.sh b/nextcloud/rootfs/etc/cont-init.d/99-trusted_domains.sh index 59036b0a9..31829741e 100644 --- a/nextcloud/rootfs/etc/cont-init.d/99-trusted_domains.sh +++ b/nextcloud/rootfs/etc/cont-init.d/99-trusted_domains.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash LAUNCHER="sudo -u abc php /data/config/www/nextcloud/occ" || bashio::log.info "/data/config/www/nextcloud/occ not found" if ! bashio::fs.file_exists '/data/config/www/nextcloud/occ'; then @@ -20,15 +21,15 @@ if bashio::config.has_value 'trusted_domains'; then bashio::log.info "Currently set trusted domains :" $LAUNCHER config:system:get trusted_domains || bashio::log.info "No trusted domain set yet. The first one will be set when doing initial configuration" - bashio::log.info "Trusted domains set in the configuration. Refreshing domains." && \ - ################################### - # Remove previous trusted domains # - ################################### - bashio::log.info "... removing previously added trusted domain (except for first one created)" + bashio::log.info "Trusted domains set in the configuration. Refreshing domains." && + ################################### + # Remove previous trusted domains # + ################################### + bashio::log.info "... removing previously added trusted domain (except for first one created)" i=2 until [ $i -gt 5 ]; do - $LAUNCHER config:system:delete trusted_domains $i && \ - ((i = i + 1)) || exit + $LAUNCHER config:system:delete trusted_domains $i && + ((i = i + 1)) || exit done ########################### diff --git a/nzbget/rootfs/etc/cont-init.d/20-folders.sh b/nzbget/rootfs/etc/cont-init.d/20-folders.sh index abd174d25..0a1fef528 100644 --- a/nzbget/rootfs/etc/cont-init.d/20-folders.sh +++ b/nzbget/rootfs/etc/cont-init.d/20-folders.sh @@ -1,17 +1,17 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash slug=nzbget - if [ ! -d /config/addons_config/$slug ]; then -if [ -d /config/$slug ]; then - echo "Moving to new location /config/addons_config/$slug" - mkdir -p /config/addons_config/$slug - chmod 777 /config/addons_config/$slug - mv /config/$slug/* /config/addons_config/$slug/ - rm -r /config/$slug -fi + if [ -d /config/$slug ]; then + echo "Moving to new location /config/addons_config/$slug" + mkdir -p /config/addons_config/$slug + chmod 777 /config/addons_config/$slug + mv /config/$slug/* /config/addons_config/$slug/ + rm -r /config/$slug + fi echo "Creating /config/addons_config/$slug" mkdir -p /config/addons_config/$slug diff --git a/ombi/rootfs/etc/cont-init.d/20-folders.sh b/ombi/rootfs/etc/cont-init.d/20-folders.sh index ee21b5fa8..3fed51770 100644 --- a/ombi/rootfs/etc/cont-init.d/20-folders.sh +++ b/ombi/rootfs/etc/cont-init.d/20-folders.sh @@ -1,17 +1,17 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash slug=ombi - if [ ! -d /config/addons_config/$slug ]; then -if [ -d /config/$slug ]; then - echo "Moving to new location /config/addons_config/$slug" - mkdir -p /config/addons_config/$slug - chmod 777 /config/addons_config/$slug - mv /config/$slug/* /config/addons_config/$slug/ - rm -r /config/$slug -fi + if [ -d /config/$slug ]; then + echo "Moving to new location /config/addons_config/$slug" + mkdir -p /config/addons_config/$slug + chmod 777 /config/addons_config/$slug + mv /config/$slug/* /config/addons_config/$slug/ + rm -r /config/$slug + fi echo "Creating /config/addons_config/$slug" mkdir -p /config/addons_config/$slug diff --git a/organizr/rootfs/etc/cont-init.d/00-folders.sh b/organizr/rootfs/etc/cont-init.d/00-folders.sh index bcbf8ac5a..27b6ce92c 100644 --- a/organizr/rootfs/etc/cont-init.d/00-folders.sh +++ b/organizr/rootfs/etc/cont-init.d/00-folders.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash if [ ! -d /data/organizr ]; then echo "Creating /data/organizr" diff --git a/paperless_ng/rootfs/etc/cont-init.d/20-folders.sh b/paperless_ng/rootfs/etc/cont-init.d/20-folders.sh index 954fd57d9..27902cd8b 100644 --- a/paperless_ng/rootfs/etc/cont-init.d/20-folders.sh +++ b/paperless_ng/rootfs/etc/cont-init.d/20-folders.sh @@ -1,17 +1,17 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash slug=paperless - if [ ! -d /config/addons_config/$slug ]; then -if [ -d /config/$slug ]; then - echo "Moving to new location /config/addons_config/$slug" - mkdir -p /config/addons_config/$slug - chmod 777 /config/addons_config/$slug - mv /config/$slug/* /config/addons_config/$slug/ - rm -r /config/$slug -fi + if [ -d /config/$slug ]; then + echo "Moving to new location /config/addons_config/$slug" + mkdir -p /config/addons_config/$slug + chmod 777 /config/addons_config/$slug + mv /config/$slug/* /config/addons_config/$slug/ + rm -r /config/$slug + fi echo "Creating /config/addons_config/$slug" mkdir -p /config/addons_config/$slug diff --git a/paperless_ng/rootfs/etc/cont-init.d/91-pikepdf.sh b/paperless_ng/rootfs/etc/cont-init.d/91-pikepdf.sh index 49f9134a7..bf7a9682b 100644 --- a/paperless_ng/rootfs/etc/cont-init.d/91-pikepdf.sh +++ b/paperless_ng/rootfs/etc/cont-init.d/91-pikepdf.sh @@ -1,13 +1,14 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash echo "Installing pikepdf..." ( -export DEBIAN_FRONTEND="noninteractive" -export TERM="xterm-256color" -apt-get update -apt-get install -yq libxml2-dev libxslt-dev python-dev -apt-get install -yq libjpeg-dev zlib1g-dev -apt-get install -yq python3-dev build-essential -pip install pikepdf --force-reinstall + export DEBIAN_FRONTEND="noninteractive" + export TERM="xterm-256color" + apt-get update + apt-get install -yq libxml2-dev libxslt-dev python-dev + apt-get install -yq libjpeg-dev zlib1g-dev + apt-get install -yq python3-dev build-essential + pip install pikepdf --force-reinstall ) >/dev/null -echo "... success!" +echo "... success!" diff --git a/paperless_ng/rootfs/etc/cont-init.d/93-multiocr.sh b/paperless_ng/rootfs/etc/cont-init.d/93-multiocr.sh index 7b4118fd7..80240d3f2 100644 --- a/paperless_ng/rootfs/etc/cont-init.d/93-multiocr.sh +++ b/paperless_ng/rootfs/etc/cont-init.d/93-multiocr.sh @@ -1,11 +1,12 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash OCRLANG=$(bashio::config 'OCRLANG') if [ -n "$OCRLANG" ]; then apt-get update &>/dev/null echo "OCRLANG variable is set, processing the language packages" for i in ${OCRLANG//,/ }; do - if apt-cache show tesseract-ocr-"${i}" > /dev/null 2>&1; then + if apt-cache show tesseract-ocr-"${i}" >/dev/null 2>&1; then apt-get install -yq tesseract-ocr-"${i}" bashio::log.info "OCR Language installed : $i" || bashio::log.fatal "Couldn't install OCR lang $i. Please check its format is conform" else diff --git a/papermerge/rootfs/etc/cont-init.d/91-OCR.sh b/papermerge/rootfs/etc/cont-init.d/91-OCR.sh index e642780f0..e1d35fcf7 100644 --- a/papermerge/rootfs/etc/cont-init.d/91-OCR.sh +++ b/papermerge/rootfs/etc/cont-init.d/91-OCR.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash # Allow OCR setting OCRLANG="$(bashio::config "ocrlang")" diff --git a/papermerge/rootfs/etc/cont-init.d/99-configuration.sh b/papermerge/rootfs/etc/cont-init.d/99-configuration.sh index f9ef36433..577b925af 100644 --- a/papermerge/rootfs/etc/cont-init.d/99-configuration.sh +++ b/papermerge/rootfs/etc/cont-init.d/99-configuration.sh @@ -1,24 +1,25 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ################## # SELECT FOLDERS # ################## - #Set media dir - MEDIADIR='"'$(bashio::config 'storage_dir')'"' - #clean data - sed -i '/MEDIA_DIR/d' /data/config/papermerge.conf.py - #add data - sed -i "2 i\MEDIA_DIR = $MEDIADIR" /data/config/papermerge.conf.py - bashio::log.info "Storage dir set to $MEDIADIR" +#Set media dir +MEDIADIR='"'$(bashio::config 'storage_dir')'"' +#clean data +sed -i '/MEDIA_DIR/d' /data/config/papermerge.conf.py +#add data +sed -i "2 i\MEDIA_DIR = $MEDIADIR" /data/config/papermerge.conf.py +bashio::log.info "Storage dir set to $MEDIADIR" - #Set import dir - IMPORTDIR='"'$(bashio::config 'import_dir')'"' - #clean data - sed -i '/IMPORTER_DIR/d' /data/config/papermerge.conf.py || true - #add data - sed -i "2 i\IMPORTER_DIR = $MEDIADIR" /data/config/papermerge.conf.py - bashio::log.info "Import dir set to $IMPORTDIR" +#Set import dir +IMPORTDIR='"'$(bashio::config 'import_dir')'"' +#clean data +sed -i '/IMPORTER_DIR/d' /data/config/papermerge.conf.py || true +#add data +sed -i "2 i\IMPORTER_DIR = $MEDIADIR" /data/config/papermerge.conf.py +bashio::log.info "Import dir set to $IMPORTDIR" ################## # CREATE FOLDERS # @@ -30,16 +31,14 @@ if [ ! -d /config ]; then fi chown -R abc:abc /config - if [ ! -d $MEDIADIR ]; then echo "Creating $MEDIADIR" mkdir -p $MEDIADIR fi chown -R abc:abc $MEDIADIR - if [ ! -d $IMPORTDIR ]; then echo "Creating $IMPORTDIR" mkdir -p $IMPORTDIR -fi +fi chown -R abc:abc $IMPORTDIR diff --git a/piwigo/rootfs/etc/cont-init.d/41-folders.sh b/piwigo/rootfs/etc/cont-init.d/41-folders.sh index fd8944ae4..a61f2fce0 100644 --- a/piwigo/rootfs/etc/cont-init.d/41-folders.sh +++ b/piwigo/rootfs/etc/cont-init.d/41-folders.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ################## # SYMLINK CONFIG # diff --git a/plex/rootfs/etc/cont-init.d/21-folders.sh b/plex/rootfs/etc/cont-init.d/21-folders.sh index d1b8873ed..c9210f581 100644 --- a/plex/rootfs/etc/cont-init.d/21-folders.sh +++ b/plex/rootfs/etc/cont-init.d/21-folders.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ################## # SYMLINK CONFIG # diff --git a/portainer/rootfs/etc/cont-init.d/00-aaa_portainer_install.sh b/portainer/rootfs/etc/cont-init.d/00-aaa_portainer_install.sh index 1568ae134..012311bd9 100644 --- a/portainer/rootfs/etc/cont-init.d/00-aaa_portainer_install.sh +++ b/portainer/rootfs/etc/cont-init.d/00-aaa_portainer_install.sh @@ -1,6 +1,7 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash if [ -e "/PORTFILE" ]; then - echo "Installing portainer..." + echo "Installing portainer..." BUILD_UPSTREAM=$(/dev/null +unzip -o vuetorrent.zip -d / >/dev/null rm /vuetorrent.zip >/dev/null diff --git a/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh b/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh index fd98dd5f3..a3c29cba6 100644 --- a/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ########## # INIT # @@ -28,7 +29,7 @@ fi if bashio::config.has_value 'SavePath'; then DOWNLOADS=$(bashio::config 'SavePath') #sed -i '/DefaultSavePath/d' qBittorrent.conf - #sed -i "$LINE i\Session\\\DefaultSavePath=$DOWNLOADS" qBittorrent.conf + #sed -i "$LINE i\Session\\\DefaultSavePath=$DOWNLOADS" qBittorrent.conf sed -i '/SavePath/d' qBittorrent.conf sed -i "$LINE i\Downloads\\\SavePath=$DOWNLOADS" qBittorrent.conf mkdir -p $DOWNLOADS || bashio::log.fatal "Error : folder defined in SavePath doesn't exist and can't be created. Check path" diff --git a/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh b/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh index 728139953..a6e54f945 100644 --- a/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash # ============================================================================== declare openvpn_config diff --git a/qbittorrent/rootfs/etc/openvpn/up-qbittorrent.sh b/qbittorrent/rootfs/etc/openvpn/up-qbittorrent.sh index 0462645eb..e5adbdf04 100644 --- a/qbittorrent/rootfs/etc/openvpn/up-qbittorrent.sh +++ b/qbittorrent/rootfs/etc/openvpn/up-qbittorrent.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash WEBUI_PORT=${WEBUI_PORT:-8080} diff --git a/qbittorrent/rootfs/etc/services.d/nginx/run b/qbittorrent/rootfs/etc/services.d/nginx/run index daf56fe17..07447d8b8 100644 --- a/qbittorrent/rootfs/etc/services.d/nginx/run +++ b/qbittorrent/rootfs/etc/services.d/nginx/run @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash # ============================================================================== # Wait for transmission to become available diff --git a/qbittorrent/rootfs/etc/services.d/qbittorrent/run b/qbittorrent/rootfs/etc/services.d/qbittorrent/run index 777edec57..8a8780ce1 100644 --- a/qbittorrent/rootfs/etc/services.d/qbittorrent/run +++ b/qbittorrent/rootfs/etc/services.d/qbittorrent/run @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash WEBUI_PORT=${WEBUI_PORT:-8080} diff --git a/qbittorrent/rootfs/etc/services.d/qbittorrent/timer b/qbittorrent/rootfs/etc/services.d/qbittorrent/timer index c4155c095..cdcca4042 100644 --- a/qbittorrent/rootfs/etc/services.d/qbittorrent/timer +++ b/qbittorrent/rootfs/etc/services.d/qbittorrent/timer @@ -1,17 +1,20 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash WEBUI_PORT=${WEBUI_PORT:-8080} RUNTIME=$(bashio::config 'run_duration') if bashio::config.true 'openvpn_enabled'; then exec /usr/sbin/openvpn --config /etc/openvpn/config.ovpn --script-security 2 --up /etc/openvpn/up.sh --down /etc/openvpn/down.sh \ - & bashio::log.warning "The run_duration option is set. The addon will stop after $RUNTIME" + & + bashio::log.warning "The run_duration option is set. The addon will stop after $RUNTIME" else exec s6-setuidgid abc /usr/bin/qbittorrent-nox --webui-port="${WEBUI_PORT}" \ - & bashio::log.warning "The run_duration option is set. The addon will stop after $RUNTIME" -fi + & + bashio::log.warning "The run_duration option is set. The addon will stop after $RUNTIME" +fi sleep $RUNTIME || bashio::log.fatal "run_duration format is not correct. Use 5d or 5h or 5m for example" -bashio::log.info "Timeout achieved, addon will stop !" +bashio::log.info "Timeout achieved, addon will stop !" sleep 60s bashio::addon.stop diff --git a/readarr/rootfs/etc/cont-init.d/00-config_location.sh b/readarr/rootfs/etc/cont-init.d/00-config_location.sh index 1f9bea93f..695d2772d 100644 --- a/readarr/rootfs/etc/cont-init.d/00-config_location.sh +++ b/readarr/rootfs/etc/cont-init.d/00-config_location.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash CONFIG_LOCATION=$(bashio::config 'CONFIG_LOCATION') bashio::log.info "Config stored in $CONFIG_LOCATION" diff --git a/scrutiny/rootfs/etc/cont-init.d/31-run.sh b/scrutiny/rootfs/etc/cont-init.d/31-run.sh index 6c381c242..4947166c4 100644 --- a/scrutiny/rootfs/etc/cont-init.d/31-run.sh +++ b/scrutiny/rootfs/etc/cont-init.d/31-run.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ############## # Data usage # @@ -13,12 +14,12 @@ chown -R abc:abc /data # correct viewport bug # grep -rl '"lt-md":"(max-width: 959px)"' /app | xargs sed -i 's|"lt-md":"(max-width: 959px)"|"lt-md":"(max-width: 100px)"|g' || true - + ###################### # API URL CORRECTION # ###################### -# allow true url for ingress +# allow true url for ingress grep -rl '/api/' /app | xargs sed -i 's|/api/|api/|g' || true grep -rl 'api/' /app | xargs sed -i 's|api/|./api/|g' || true @@ -35,15 +36,15 @@ FREQUENCY=$(bashio::config 'Updates') bashio::log.info "$FREQUENCY updates" case $FREQUENCY in - "Hourly") - sed -i -e '$a 0 * * * * /run.sh' /etc/crontabs/root - ;; +"Hourly") + sed -i -e '$a 0 * * * * /run.sh' /etc/crontabs/root + ;; - "Daily") - sed -i -e '$a 0 0 * * * /run.sh' /etc/crontabs/root - ;; +"Daily") + sed -i -e '$a 0 0 * * * /run.sh' /etc/crontabs/root + ;; - "Weekly") - sed -i -e '$a 0 0 * * 0 /run.sh' /etc/crontabs/root - ;; +"Weekly") + sed -i -e '$a 0 0 * * 0 /run.sh' /etc/crontabs/root + ;; esac diff --git a/scrutiny/rootfs/etc/cont-init.d/32-nginx.sh b/scrutiny/rootfs/etc/cont-init.d/32-nginx.sh index 4204ba072..6ac38a5b6 100644 --- a/scrutiny/rootfs/etc/cont-init.d/32-nginx.sh +++ b/scrutiny/rootfs/etc/cont-init.d/32-nginx.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ################# # NGINX SETTING # diff --git a/scrutiny/rootfs/etc/services.d/nginx/run b/scrutiny/rootfs/etc/services.d/nginx/run index daf56fe17..07447d8b8 100644 --- a/scrutiny/rootfs/etc/services.d/nginx/run +++ b/scrutiny/rootfs/etc/services.d/nginx/run @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash # ============================================================================== # Wait for transmission to become available diff --git a/scrutiny/rootfs/run.sh b/scrutiny/rootfs/run.sh index 1d7a07077..706b3a921 100644 --- a/scrutiny/rootfs/run.sh +++ b/scrutiny/rootfs/run.sh @@ -1,12 +1,12 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash # wait for scrutiny to load bashio::net.wait_for 8080 - ##################### # ADD LOCAL DEVICES # ##################### # search for local devices -scrutiny-collector-metrics run >/dev/null && bashio::log.info "Local Devices Added" || bashio::log.error "Local Devices Not Added" +scrutiny-collector-metrics run >/dev/null && bashio::log.info "Local Devices Added" || bashio::log.error "Local Devices Not Added" diff --git a/tandoor_recipes/rootfs/etc/cont-init.d/20-folders.sh b/tandoor_recipes/rootfs/etc/cont-init.d/20-folders.sh index 6976e21a0..2650b5073 100644 --- a/tandoor_recipes/rootfs/etc/cont-init.d/20-folders.sh +++ b/tandoor_recipes/rootfs/etc/cont-init.d/20-folders.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash slug="tandoor_recipes" diff --git a/tandoor_recipes/rootfs/etc/cont-init.d/99-run.sh b/tandoor_recipes/rootfs/etc/cont-init.d/99-run.sh index cb6cb87c0..d41d61e4e 100644 --- a/tandoor_recipes/rootfs/etc/cont-init.d/99-run.sh +++ b/tandoor_recipes/rootfs/etc/cont-init.d/99-run.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ##################### # Export env values # @@ -26,20 +27,20 @@ mariadb_addon) bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Discovering values..." if ! bashio::services.available 'mysql'; then bashio::log.fatal \ - "Local database access should be provided by the MariaDB addon" + "Local database access should be provided by the MariaDB addon" bashio::exit.nok \ - "Please ensure it is installed and started" + "Please ensure it is installed and started" fi # Install mysqlclient pip install pymysql &>/dev/null - + # Use values export DB_ENGINE=django.db.backends.mysql export POSTGRES_HOST=$(bashio::services "mysql" "host") && bashio::log.blue "POSTGRES_HOST=$POSTGRES_HOST" export POSTGRES_PORT=$(bashio::services "mysql" "port") && bashio::log.blue "POSTGRES_PORT=$POSTGRES_PORT" export POSTGRES_DB=/data/ - + .db && bashio::log.blue "POSTGRES_DB=$POSTGRES_DB" export POSTGRES_USER=$(bashio::services "mysql" "username") && bashio::log.blue "POSTGRES_USER=$POSTGRES_USER" export POSTGRES_PASSWORD=$(bashio::services "mysql" "password") && bashio::log.blue "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" @@ -74,4 +75,4 @@ ln -s /data/recipes/staticfiles /opt/recipes bashio::log.info "Launching app" cd /opt/recipes -./boot.sh +./boot.sh diff --git a/transmission/rootfs/etc/cont-init.d/19-config.sh b/transmission/rootfs/etc/cont-init.d/19-config.sh index 9a6a837a7..c75611dbe 100644 --- a/transmission/rootfs/etc/cont-init.d/19-config.sh +++ b/transmission/rootfs/etc/cont-init.d/19-config.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash rm -rf /etc/cont-init.d/20-config || true @@ -37,7 +38,7 @@ fi if bashio::config.has_value 'customUI'; then CUSTOMUI=$(bashio::config 'customUI') [ $CUSTOMUI != "standard" ] && sed -i "1a export TRANSMISSION_WEB_HOME=\"/$CUSTOMUI/\"" /etc/services.d/transmission/run - + # Enable transmission-web-control return to default UI if [ ! -f "/transmission-web-control/index.original.html" ]; then ln -s /usr/share/transmission/web/style /transmission-web-control 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 24dd1ac0e..bd9fcb787 100644 --- a/transmission/rootfs/etc/cont-init.d/19-json_repair.sh +++ b/transmission/rootfs/etc/cont-init.d/19-json_repair.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash JSONTOCHECK='/config/transmission/settings.json' JSONSOURCE='/defaults/settings.json' diff --git a/ubooquity/rootfs/etc/32-nginx_ingress.sh b/ubooquity/rootfs/etc/32-nginx_ingress.sh index 8d500585c..69ef19156 100644 --- a/ubooquity/rootfs/etc/32-nginx_ingress.sh +++ b/ubooquity/rootfs/etc/32-nginx_ingress.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ################### # INGRESS SETTING # @@ -11,7 +12,7 @@ declare keyfile # General values port=$(bashio::addon.ingress_port) -if [ $port > 1 ]; then +if [ $port ] >1; then # Adapt nginx sed -i "s|%%port%%|$port|g" /etc/nginx/servers/ingress.conf sed -i "s|%%interface%%|$(bashio::addon.ip_address)|g" /etc/nginx/servers/ingress.conf diff --git a/ubooquity/rootfs/etc/cont-init.d/20-folders.sh b/ubooquity/rootfs/etc/cont-init.d/20-folders.sh index 5422518a3..6eb91d333 100644 --- a/ubooquity/rootfs/etc/cont-init.d/20-folders.sh +++ b/ubooquity/rootfs/etc/cont-init.d/20-folders.sh @@ -1,17 +1,17 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash slug=ubooquity - if [ ! -d /config/addons_config/$slug ]; then -if [ -d /config/$slug ]; then - echo "Moving to new location /config/addons_config/$slug" - mkdir -p /config/addons_config/$slug - chmod 777 /config/addons_config/$slug - mv /config/$slug/* /config/addons_config/$slug/ - rm -r /config/$slug -fi + if [ -d /config/$slug ]; then + echo "Moving to new location /config/addons_config/$slug" + mkdir -p /config/addons_config/$slug + chmod 777 /config/addons_config/$slug + mv /config/$slug/* /config/addons_config/$slug/ + rm -r /config/$slug + fi echo "Creating /config/addons_config/$slug" mkdir -p /config/addons_config/$slug diff --git a/ubooquity/rootfs/etc/cont-init.d/32-nginx_ssl.sh b/ubooquity/rootfs/etc/cont-init.d/32-nginx_ssl.sh index 7a19d1bf5..1f5c37930 100644 --- a/ubooquity/rootfs/etc/cont-init.d/32-nginx_ssl.sh +++ b/ubooquity/rootfs/etc/cont-init.d/32-nginx_ssl.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ############### # SSL SETTING # diff --git a/ubooquity/rootfs/etc/cont-init.d/91-configuration.sh b/ubooquity/rootfs/etc/cont-init.d/91-configuration.sh index bb24213b7..93352edf3 100644 --- a/ubooquity/rootfs/etc/cont-init.d/91-configuration.sh +++ b/ubooquity/rootfs/etc/cont-init.d/91-configuration.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ########### # FOLDERS # diff --git a/ubooquity/rootfs/etc/cont-init.d/93-custom_webUI.sh b/ubooquity/rootfs/etc/cont-init.d/93-custom_webUI.sh index 9b3178fa6..557c6cc7f 100644 --- a/ubooquity/rootfs/etc/cont-init.d/93-custom_webUI.sh +++ b/ubooquity/rootfs/etc/cont-init.d/93-custom_webUI.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash ################ # Alternate UI # diff --git a/ubooquity/rootfs/etc/services.d/nginx/run b/ubooquity/rootfs/etc/services.d/nginx/run index 876ba2f0f..f773aec81 100644 --- a/ubooquity/rootfs/etc/services.d/nginx/run +++ b/ubooquity/rootfs/etc/services.d/nginx/run @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash # ============================================================================== # Wait for transmission to become available diff --git a/webtop/rootfs/etc/cont-init.d/20-folders.sh b/webtop/rootfs/etc/cont-init.d/20-folders.sh index 186dad869..0ebc71563 100644 --- a/webtop/rootfs/etc/cont-init.d/20-folders.sh +++ b/webtop/rootfs/etc/cont-init.d/20-folders.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash # Define home HOME="/share/webtop" diff --git a/webtop/rootfs/etc/cont-init.d/99-run.sh b/webtop/rootfs/etc/cont-init.d/99-run.sh index 14a2f4c47..c8618e3d5 100644 --- a/webtop/rootfs/etc/cont-init.d/99-run.sh +++ b/webtop/rootfs/etc/cont-init.d/99-run.sh @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bashio +# shellcheck shell=bash # Uprade echo "Updating distribution" @@ -8,20 +9,20 @@ apt-get -y upgrade >/dev/null || true # Fix mate software center if [ -f /usr/lib/dbus-1.0/dbus-daemon-launch-helper ]; then -echo "Allow software center" -chmod u+s /usr/lib/dbus-1.0/dbus-daemon-launch-helper -service dbus restart + echo "Allow software center" + chmod u+s /usr/lib/dbus-1.0/dbus-daemon-launch-helper + service dbus restart fi # Install specific apps if bashio::config.has_value 'additional_apps'; then - bashio::log.info "Installing additional apps :" - # Install apps - for APP in $(echo "$(bashio::config 'additional_apps')" | tr "," " "); do - bashio::log.green "... $APP" - # Test install with both apt-get and snap - apt-get install -yqq $APP &>/dev/null \ - && bashio::log.green "... done" \ - || bashio::log.red "... not successful, please check package name" - done + bashio::log.info "Installing additional apps :" + # Install apps + for APP in $(echo "$(bashio::config 'additional_apps')" | tr "," " "); do + bashio::log.green "... $APP" + # Test install with both apt-get and snap + apt-get install -yqq $APP &>/dev/null && + bashio::log.green "... done" || + bashio::log.red "... not successful, please check package name" + done fi