diff --git a/bazarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/bazarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/bazarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/bazarr/root/etc/cont-init.d/00-banner.sh b/bazarr/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 54d7d491a..000000000 --- a/bazarr/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/bazarr/root/etc/cont-init.d/00-ha-env b/bazarr/root/etc/cont-init.d/00-ha-env deleted file mode 100644 index 3b3e69246..000000000 --- a/bazarr/root/etc/cont-init.d/00-ha-env +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bashio - -for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do - printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k -done \ No newline at end of file diff --git a/bazarr/root/etc/cont-init.d/20-folders b/bazarr/root/etc/cont-init.d/20-folders deleted file mode 100644 index 73e1f22de..000000000 --- a/bazarr/root/etc/cont-init.d/20-folders +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/with-contenv bash - -if [ ! -d /share/storage/movies ]; then - echo "Creating /share/storage/movies" - mkdir -p /share/storage/movies - chown -R abc:abc /share/storage/movies -fi - -if [ ! -d /share/downloads ]; then - echo "Creating /share/downloads" - mkdir -p /share/downloads - chown -R abc:abc /share/downloads -fi - -if [ ! -d /config/bazarr ]; then - echo "Creating /config/bazarr" - mkdir -p /config/bazarr - chown -R abc:abc /config/bazarr -fi diff --git a/bazarr/root/etc/cont-init.d/92-local_mounts.sh b/bazarr/root/etc/cont-init.d/92-local_mounts.sh deleted file mode 100644 index 0920d68bd..000000000 --- a/bazarr/root/etc/cont-init.d/92-local_mounts.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/with-contenv bashio - -###################### -# MOUNT LOCAL SHARES # -###################### - -# Mount local Share if configured -if bashio::config.has_value 'localdisks'; then - - MOREDISKS=$(bashio::config 'localdisks') - echo "Local Disks mounting..." - - # Separate comma separated values - for disk in ${MOREDISKS//,/ }; do - - # Mount by device as default - devpath=/dev - - # Mount as label - [ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label - - # Creates dir - mkdir -p /mnt/$disk - chown -R $(id -u):$(id -g) /mnt/$disk - # Legacy mounting : mount to share if still exists (avoid breaking changes) - [ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true - # Mount - mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk) - - done - -fi diff --git a/bazarr/root/etc/cont-init.d/92-smb_mounts.sh b/bazarr/root/etc/cont-init.d/92-smb_mounts.sh deleted file mode 100644 index 06410e554..000000000 --- a/bazarr/root/etc/cont-init.d/92-smb_mounts.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/with-contenv bashio - -######################### -# MOUNT SMB SHARES v1.6 # -######################### -if bashio::config.has_value 'networkdisks'; then - - # Define variables - MOREDISKS=$(bashio::config 'networkdisks') - CIFS_USERNAME=$(bashio::config 'cifsusername') - CIFS_PASSWORD=$(bashio::config 'cifspassword') - MOUNTED=false - SMBVERS="" - SECVERS="" - - # Mount CIFS Share if configured and if Protection Mode is active - echo 'Mounting smb share(s)...' - - if bashio::config.has_value 'cifsdomain'; then - DOMAIN=",domain=$(bashio::config 'cifsdomain')" - else - DOMAIN="" - fi - - # Mounting disks - for disk in ${MOREDISKS//,/ }; do # Separate comma separated values - - # Clean name of network share - disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name - diskname=${disk//\\//} #replace \ with / - diskname=${diskname##*/} # Get only last part of the name - - # Data validation - if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then - bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future." - exit 0 - fi - - # Prepare mount point - mkdir -p /mnt/$diskname - chown -R root:root /mnt/$diskname - - #Tries to mount with default options - mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false - - # if Fail test different smb and sec versions - if [ $MOUNTED = false ]; then - for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false - for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false - done - done - fi - - # Messages - if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then - #Test write permissions - touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && - bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || - bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw" - - else - # Mounting failed messages - bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" - bashio::log.fatal "Here is some debugging info :" - - # Provide debugging info - smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client - #smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - - # Error code - bashio::log.fatal "Error read : $(/dev/null || true - rmdir /mnt/$diskname || true - fi - - done -fi diff --git a/booksonic_air/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/booksonic_air/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/booksonic_air/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/booksonic_air/root/etc/cont-init.d/00-banner.sh b/booksonic_air/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 54d7d491a..000000000 --- a/booksonic_air/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/booksonic_air/root/etc/cont-init.d/00-ha-env b/booksonic_air/root/etc/cont-init.d/00-ha-env deleted file mode 100644 index 342068f41..000000000 --- a/booksonic_air/root/etc/cont-init.d/00-ha-env +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bashio - -for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do - printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k -done diff --git a/booksonic_air/root/etc/cont-init.d/92-local_mounts.sh b/booksonic_air/root/etc/cont-init.d/92-local_mounts.sh deleted file mode 100644 index 0920d68bd..000000000 --- a/booksonic_air/root/etc/cont-init.d/92-local_mounts.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/with-contenv bashio - -###################### -# MOUNT LOCAL SHARES # -###################### - -# Mount local Share if configured -if bashio::config.has_value 'localdisks'; then - - MOREDISKS=$(bashio::config 'localdisks') - echo "Local Disks mounting..." - - # Separate comma separated values - for disk in ${MOREDISKS//,/ }; do - - # Mount by device as default - devpath=/dev - - # Mount as label - [ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label - - # Creates dir - mkdir -p /mnt/$disk - chown -R $(id -u):$(id -g) /mnt/$disk - # Legacy mounting : mount to share if still exists (avoid breaking changes) - [ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true - # Mount - mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk) - - done - -fi diff --git a/booksonic_air/root/etc/cont-init.d/92-smb_mounts.sh b/booksonic_air/root/etc/cont-init.d/92-smb_mounts.sh deleted file mode 100644 index 06410e554..000000000 --- a/booksonic_air/root/etc/cont-init.d/92-smb_mounts.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/with-contenv bashio - -######################### -# MOUNT SMB SHARES v1.6 # -######################### -if bashio::config.has_value 'networkdisks'; then - - # Define variables - MOREDISKS=$(bashio::config 'networkdisks') - CIFS_USERNAME=$(bashio::config 'cifsusername') - CIFS_PASSWORD=$(bashio::config 'cifspassword') - MOUNTED=false - SMBVERS="" - SECVERS="" - - # Mount CIFS Share if configured and if Protection Mode is active - echo 'Mounting smb share(s)...' - - if bashio::config.has_value 'cifsdomain'; then - DOMAIN=",domain=$(bashio::config 'cifsdomain')" - else - DOMAIN="" - fi - - # Mounting disks - for disk in ${MOREDISKS//,/ }; do # Separate comma separated values - - # Clean name of network share - disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name - diskname=${disk//\\//} #replace \ with / - diskname=${diskname##*/} # Get only last part of the name - - # Data validation - if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then - bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future." - exit 0 - fi - - # Prepare mount point - mkdir -p /mnt/$diskname - chown -R root:root /mnt/$diskname - - #Tries to mount with default options - mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false - - # if Fail test different smb and sec versions - if [ $MOUNTED = false ]; then - for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false - for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false - done - done - fi - - # Messages - if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then - #Test write permissions - touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && - bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || - bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw" - - else - # Mounting failed messages - bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" - bashio::log.fatal "Here is some debugging info :" - - # Provide debugging info - smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client - #smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - - # Error code - bashio::log.fatal "Error read : $(/dev/null || true - rmdir /mnt/$diskname || true - fi - - done -fi diff --git a/code-server/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/code-server/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/code-server/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/code-server/root/etc/cont-init.d/00-banner.sh b/code-server/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 0ac294e9a..000000000 --- a/code-server/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/code-server/root/etc/cont-init.d/92-local_mounts.sh b/code-server/root/etc/cont-init.d/92-local_mounts.sh deleted file mode 100644 index 0920d68bd..000000000 --- a/code-server/root/etc/cont-init.d/92-local_mounts.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/with-contenv bashio - -###################### -# MOUNT LOCAL SHARES # -###################### - -# Mount local Share if configured -if bashio::config.has_value 'localdisks'; then - - MOREDISKS=$(bashio::config 'localdisks') - echo "Local Disks mounting..." - - # Separate comma separated values - for disk in ${MOREDISKS//,/ }; do - - # Mount by device as default - devpath=/dev - - # Mount as label - [ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label - - # Creates dir - mkdir -p /mnt/$disk - chown -R $(id -u):$(id -g) /mnt/$disk - # Legacy mounting : mount to share if still exists (avoid breaking changes) - [ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true - # Mount - mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk) - - done - -fi diff --git a/code-server/root/etc/cont-init.d/92-smb_mounts.sh b/code-server/root/etc/cont-init.d/92-smb_mounts.sh deleted file mode 100644 index 06410e554..000000000 --- a/code-server/root/etc/cont-init.d/92-smb_mounts.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/with-contenv bashio - -######################### -# MOUNT SMB SHARES v1.6 # -######################### -if bashio::config.has_value 'networkdisks'; then - - # Define variables - MOREDISKS=$(bashio::config 'networkdisks') - CIFS_USERNAME=$(bashio::config 'cifsusername') - CIFS_PASSWORD=$(bashio::config 'cifspassword') - MOUNTED=false - SMBVERS="" - SECVERS="" - - # Mount CIFS Share if configured and if Protection Mode is active - echo 'Mounting smb share(s)...' - - if bashio::config.has_value 'cifsdomain'; then - DOMAIN=",domain=$(bashio::config 'cifsdomain')" - else - DOMAIN="" - fi - - # Mounting disks - for disk in ${MOREDISKS//,/ }; do # Separate comma separated values - - # Clean name of network share - disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name - diskname=${disk//\\//} #replace \ with / - diskname=${diskname##*/} # Get only last part of the name - - # Data validation - if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then - bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future." - exit 0 - fi - - # Prepare mount point - mkdir -p /mnt/$diskname - chown -R root:root /mnt/$diskname - - #Tries to mount with default options - mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false - - # if Fail test different smb and sec versions - if [ $MOUNTED = false ]; then - for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false - for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false - done - done - fi - - # Messages - if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then - #Test write permissions - touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && - bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || - bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw" - - else - # Mounting failed messages - bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" - bashio::log.fatal "Here is some debugging info :" - - # Provide debugging info - smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client - #smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - - # Error code - bashio::log.fatal "Error read : $(/dev/null || true - rmdir /mnt/$diskname || true - fi - - done -fi diff --git a/grav/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/grav/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/grav/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/grav/root/etc/cont-init.d/00-banner.sh b/grav/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 0ac294e9a..000000000 --- a/grav/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/grav/root/etc/cont-init.d/00-ha-env b/grav/root/etc/cont-init.d/00-ha-env deleted file mode 100644 index 342068f41..000000000 --- a/grav/root/etc/cont-init.d/00-ha-env +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bashio - -for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do - printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k -done diff --git a/grav/root/etc/cont-init.d/20-folders b/grav/root/etc/cont-init.d/20-folders deleted file mode 100644 index 5cf2a6207..000000000 --- a/grav/root/etc/cont-init.d/20-folders +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/with-contenv bashio - -echo "Updating folders..." - -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" diff --git a/jackett/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/jackett/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/jackett/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/jackett/root/etc/cont-init.d/00-banner.sh b/jackett/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 0ac294e9a..000000000 --- a/jackett/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/jackett/root/etc/cont-init.d/00-ha-env b/jackett/root/etc/cont-init.d/00-ha-env deleted file mode 100644 index 3b3e69246..000000000 --- a/jackett/root/etc/cont-init.d/00-ha-env +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bashio - -for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do - printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k -done \ No newline at end of file diff --git a/jackett/root/etc/cont-init.d/20-folders b/jackett/root/etc/cont-init.d/20-folders deleted file mode 100644 index 0a8112e46..000000000 --- a/jackett/root/etc/cont-init.d/20-folders +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/with-contenv bash - -if [ ! -d /share/storage/movies ]; then - echo "Creating /share/storage/movies" - mkdir -p /share/storage/movies - chown -R abc:abc /share/storage/movies -fi - -if [ ! -d /share/downloads ]; then - echo "Creating /share/downloads" - mkdir -p /share/downloads - chown -R abc:abc /share/downloads -fi - -if [ ! -d /config/jackett ]; then - echo "Creating /config/jackett" - mkdir -p /config/jackett - chown -R abc:abc /config/jackett -fi diff --git a/jackett/root/etc/cont-init.d/92-local_mounts.sh b/jackett/root/etc/cont-init.d/92-local_mounts.sh deleted file mode 100644 index 0920d68bd..000000000 --- a/jackett/root/etc/cont-init.d/92-local_mounts.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/with-contenv bashio - -###################### -# MOUNT LOCAL SHARES # -###################### - -# Mount local Share if configured -if bashio::config.has_value 'localdisks'; then - - MOREDISKS=$(bashio::config 'localdisks') - echo "Local Disks mounting..." - - # Separate comma separated values - for disk in ${MOREDISKS//,/ }; do - - # Mount by device as default - devpath=/dev - - # Mount as label - [ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label - - # Creates dir - mkdir -p /mnt/$disk - chown -R $(id -u):$(id -g) /mnt/$disk - # Legacy mounting : mount to share if still exists (avoid breaking changes) - [ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true - # Mount - mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk) - - done - -fi diff --git a/jackett/root/etc/cont-init.d/92-smb_mounts.sh b/jackett/root/etc/cont-init.d/92-smb_mounts.sh deleted file mode 100644 index 06410e554..000000000 --- a/jackett/root/etc/cont-init.d/92-smb_mounts.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/with-contenv bashio - -######################### -# MOUNT SMB SHARES v1.6 # -######################### -if bashio::config.has_value 'networkdisks'; then - - # Define variables - MOREDISKS=$(bashio::config 'networkdisks') - CIFS_USERNAME=$(bashio::config 'cifsusername') - CIFS_PASSWORD=$(bashio::config 'cifspassword') - MOUNTED=false - SMBVERS="" - SECVERS="" - - # Mount CIFS Share if configured and if Protection Mode is active - echo 'Mounting smb share(s)...' - - if bashio::config.has_value 'cifsdomain'; then - DOMAIN=",domain=$(bashio::config 'cifsdomain')" - else - DOMAIN="" - fi - - # Mounting disks - for disk in ${MOREDISKS//,/ }; do # Separate comma separated values - - # Clean name of network share - disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name - diskname=${disk//\\//} #replace \ with / - diskname=${diskname##*/} # Get only last part of the name - - # Data validation - if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then - bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future." - exit 0 - fi - - # Prepare mount point - mkdir -p /mnt/$diskname - chown -R root:root /mnt/$diskname - - #Tries to mount with default options - mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false - - # if Fail test different smb and sec versions - if [ $MOUNTED = false ]; then - for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false - for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false - done - done - fi - - # Messages - if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then - #Test write permissions - touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && - bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || - bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw" - - else - # Mounting failed messages - bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" - bashio::log.fatal "Here is some debugging info :" - - # Provide debugging info - smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client - #smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - - # Error code - bashio::log.fatal "Error read : $(/dev/null || true - rmdir /mnt/$diskname || true - fi - - done -fi diff --git a/jellyfin/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/jellyfin/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/jellyfin/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/jellyfin/root/etc/cont-init.d/00-banner.sh b/jellyfin/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 0ac294e9a..000000000 --- a/jellyfin/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/jellyfin/root/etc/cont-init.d/00-ha-env b/jellyfin/root/etc/cont-init.d/00-ha-env deleted file mode 100644 index 3b3e69246..000000000 --- a/jellyfin/root/etc/cont-init.d/00-ha-env +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bashio - -for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do - printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k -done \ No newline at end of file diff --git a/jellyfin/root/etc/cont-init.d/20-folders b/jellyfin/root/etc/cont-init.d/20-folders deleted file mode 100644 index 9015351ab..000000000 --- a/jellyfin/root/etc/cont-init.d/20-folders +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/with-contenv bash - -if [ ! -d /jellyfin ]; then - echo "Creating /jellyfin" - mkdir -p /jellyfin - chown -R abc:abc /jellyfin -fi - -if [ ! -d /share/storage/tv ]; then - echo "Creating /share/storage/tv" - mkdir -p /share/storage/tv - chown -R abc:abc /share/storage/tv -fi - -if [ ! -d /share/storage/movies ]; then - echo "Creating /share/storage/movies" - mkdir -p /share/storage/movies - chown -R abc:abc /share/storage/movies -fi - -if [ ! -d /share/jellyfin ]; then - echo "Creating /share/jellyfin" - mkdir -p /share/jellyfin - chown -R abc:abc /share/jellyfin -fi - -if [ ! -d /config/jellyfin ]; then - echo "Creating /config/jellyfin" - mkdir -p /config/jellyfin - chown -R abc:abc /config/jellyfin -fi - -# links - -if [ ! -d /jellyfin/cache ]; then - echo "Creating link for /jellyfin/cache" - mkdir -p /share/jellyfin/cache - chown -R abc:abc /share/jellyfin/cache - ln -s /share/jellyfin/cache /jellyfin/cache -fi - -if [ ! -d /jellyfin/config ]; then - echo "Creating link for /jellyfin/config" - mkdir -p /config/jellyfin - chown -R abc:abc /config/jellyfin - ln -s /config/jellyfin /jellyfin/config -fi - -if [ ! -d /jellyfin/data ]; then - echo "Creating link for /jellyfin/data" - mkdir -p /share/jellyfin/data - chown -R abc:abc /share/jellyfin/data - ln -s /share/jellyfin/data /jellyfin/data -fi - -if [ ! -d /jellyfin/logs ]; then - echo "Creating link for /jellyfin/logs" - mkdir -p /share/jellyfin/logs - chown -R abc:abc /share/jellyfin/logs - ln -s /share/jellyfin/logs /jellyfin/logs -fi - -if [ ! -d /jellyfin/metadata ]; then - echo "Creating link for /jellyfin/metadata" - mkdir -p /share/jellyfin/metadata - chown -R abc:abc /share/jellyfin/metadata - ln -s /share/jellyfin/metadata /jellyfin/metadata -fi - -if [ ! -d /jellyfin/plugins ]; then - echo "Creating link for /jellyfin/plugins" - mkdir -p /share/jellyfin/plugins - chown -R abc:abc /share/jellyfin/plugins - ln -s /share/jellyfin/plugins /jellyfin/plugins -fi - -if [ ! -d /jellyfin/root ]; then - echo "Creating link for /jellyfin/root" - mkdir -p /share/jellyfin/root - chown -R abc:abc /share/jellyfin/root - ln -s /share/jellyfin/root /jellyfin/root -fi diff --git a/jellyfin/root/etc/cont-init.d/92-local_mounts.sh b/jellyfin/root/etc/cont-init.d/92-local_mounts.sh deleted file mode 100644 index 0920d68bd..000000000 --- a/jellyfin/root/etc/cont-init.d/92-local_mounts.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/with-contenv bashio - -###################### -# MOUNT LOCAL SHARES # -###################### - -# Mount local Share if configured -if bashio::config.has_value 'localdisks'; then - - MOREDISKS=$(bashio::config 'localdisks') - echo "Local Disks mounting..." - - # Separate comma separated values - for disk in ${MOREDISKS//,/ }; do - - # Mount by device as default - devpath=/dev - - # Mount as label - [ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label - - # Creates dir - mkdir -p /mnt/$disk - chown -R $(id -u):$(id -g) /mnt/$disk - # Legacy mounting : mount to share if still exists (avoid breaking changes) - [ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true - # Mount - mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk) - - done - -fi diff --git a/jellyfin/root/etc/cont-init.d/92-smb_mounts.sh b/jellyfin/root/etc/cont-init.d/92-smb_mounts.sh deleted file mode 100644 index 06410e554..000000000 --- a/jellyfin/root/etc/cont-init.d/92-smb_mounts.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/with-contenv bashio - -######################### -# MOUNT SMB SHARES v1.6 # -######################### -if bashio::config.has_value 'networkdisks'; then - - # Define variables - MOREDISKS=$(bashio::config 'networkdisks') - CIFS_USERNAME=$(bashio::config 'cifsusername') - CIFS_PASSWORD=$(bashio::config 'cifspassword') - MOUNTED=false - SMBVERS="" - SECVERS="" - - # Mount CIFS Share if configured and if Protection Mode is active - echo 'Mounting smb share(s)...' - - if bashio::config.has_value 'cifsdomain'; then - DOMAIN=",domain=$(bashio::config 'cifsdomain')" - else - DOMAIN="" - fi - - # Mounting disks - for disk in ${MOREDISKS//,/ }; do # Separate comma separated values - - # Clean name of network share - disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name - diskname=${disk//\\//} #replace \ with / - diskname=${diskname##*/} # Get only last part of the name - - # Data validation - if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then - bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future." - exit 0 - fi - - # Prepare mount point - mkdir -p /mnt/$diskname - chown -R root:root /mnt/$diskname - - #Tries to mount with default options - mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false - - # if Fail test different smb and sec versions - if [ $MOUNTED = false ]; then - for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false - for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false - done - done - fi - - # Messages - if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then - #Test write permissions - touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && - bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || - bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw" - - else - # Mounting failed messages - bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" - bashio::log.fatal "Here is some debugging info :" - - # Provide debugging info - smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client - #smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - - # Error code - bashio::log.fatal "Error read : $(/dev/null || true - rmdir /mnt/$diskname || true - fi - - done -fi diff --git a/lidarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/lidarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/lidarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/lidarr/root/etc/cont-init.d/00-banner.sh b/lidarr/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 0ac294e9a..000000000 --- a/lidarr/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/lidarr/root/etc/cont-init.d/00-ha-env b/lidarr/root/etc/cont-init.d/00-ha-env deleted file mode 100644 index 342068f41..000000000 --- a/lidarr/root/etc/cont-init.d/00-ha-env +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bashio - -for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do - printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k -done diff --git a/lidarr/root/etc/cont-init.d/20-folders b/lidarr/root/etc/cont-init.d/20-folders deleted file mode 100644 index 6e2cb7cce..000000000 --- a/lidarr/root/etc/cont-init.d/20-folders +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/with-contenv bash - -if [ ! -d /share/music ]; then - echo "Creating /share/music" - mkdir -p /share/music - chown -R abc:abc /share/music -fi - -if [ ! -d /share/downloads ]; then - echo "Creating /share/downloads" - mkdir -p /share/downloads - chown -R abc:abc /share/downloads -fi - -if [ ! -d /config/lidarr ]; then - echo "Creating /config/lidarr" - mkdir -p /config/lidarr - chown -R abc:abc /config/lidarr -fi diff --git a/lidarr/root/etc/cont-init.d/92-local_mounts.sh b/lidarr/root/etc/cont-init.d/92-local_mounts.sh deleted file mode 100644 index 0920d68bd..000000000 --- a/lidarr/root/etc/cont-init.d/92-local_mounts.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/with-contenv bashio - -###################### -# MOUNT LOCAL SHARES # -###################### - -# Mount local Share if configured -if bashio::config.has_value 'localdisks'; then - - MOREDISKS=$(bashio::config 'localdisks') - echo "Local Disks mounting..." - - # Separate comma separated values - for disk in ${MOREDISKS//,/ }; do - - # Mount by device as default - devpath=/dev - - # Mount as label - [ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label - - # Creates dir - mkdir -p /mnt/$disk - chown -R $(id -u):$(id -g) /mnt/$disk - # Legacy mounting : mount to share if still exists (avoid breaking changes) - [ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true - # Mount - mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk) - - done - -fi diff --git a/lidarr/root/etc/cont-init.d/92-smb_mounts.sh b/lidarr/root/etc/cont-init.d/92-smb_mounts.sh deleted file mode 100644 index 06410e554..000000000 --- a/lidarr/root/etc/cont-init.d/92-smb_mounts.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/with-contenv bashio - -######################### -# MOUNT SMB SHARES v1.6 # -######################### -if bashio::config.has_value 'networkdisks'; then - - # Define variables - MOREDISKS=$(bashio::config 'networkdisks') - CIFS_USERNAME=$(bashio::config 'cifsusername') - CIFS_PASSWORD=$(bashio::config 'cifspassword') - MOUNTED=false - SMBVERS="" - SECVERS="" - - # Mount CIFS Share if configured and if Protection Mode is active - echo 'Mounting smb share(s)...' - - if bashio::config.has_value 'cifsdomain'; then - DOMAIN=",domain=$(bashio::config 'cifsdomain')" - else - DOMAIN="" - fi - - # Mounting disks - for disk in ${MOREDISKS//,/ }; do # Separate comma separated values - - # Clean name of network share - disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name - diskname=${disk//\\//} #replace \ with / - diskname=${diskname##*/} # Get only last part of the name - - # Data validation - if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then - bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future." - exit 0 - fi - - # Prepare mount point - mkdir -p /mnt/$diskname - chown -R root:root /mnt/$diskname - - #Tries to mount with default options - mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false - - # if Fail test different smb and sec versions - if [ $MOUNTED = false ]; then - for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false - for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false - done - done - fi - - # Messages - if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then - #Test write permissions - touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && - bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || - bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw" - - else - # Mounting failed messages - bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" - bashio::log.fatal "Here is some debugging info :" - - # Provide debugging info - smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client - #smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - - # Error code - bashio::log.fatal "Error read : $(/dev/null || true - rmdir /mnt/$diskname || true - fi - - done -fi diff --git a/nextcloud/root/defaults/config.php b/nextcloud/root/defaults/config.php deleted file mode 100644 index 367cad15d..000000000 --- a/nextcloud/root/defaults/config.php +++ /dev/null @@ -1,6 +0,0 @@ - '\OC\Memcache\APCu', - 'datadirectory' => '/share/nextcloud', - ); - diff --git a/nextcloud/root/defaults/default b/nextcloud/root/defaults/default deleted file mode 100644 index f17b71216..000000000 --- a/nextcloud/root/defaults/default +++ /dev/null @@ -1,121 +0,0 @@ -upstream php-handler { - server 127.0.0.1:9000; -} -server { - listen 80; - listen [::]:80; - server_name _; - return 301 https://$host$request_uri; -} -server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name _; - ssl_certificate /ssl/nextcloud/keys/cert.crt; - ssl_certificate_key /ssl/nextcloud/keys/cert.key; - - # Add headers to serve security related headers - # Before enabling Strict-Transport-Security headers please read into this - # topic first. - #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always; - # - # WARNING: Only add the preload option once you read about - # the consequences in https://hstspreload.org/. This option - # will add the domain to a hardcoded list that is shipped - # in all major browsers and getting removed from this list - # could take several months. - - add_header X-Content-Type-Options nosniff; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Robots-Tag none; - add_header X-Download-Options noopen; - add_header X-Frame-Options "SAMEORIGIN"; - add_header X-Permitted-Cross-Domain-Policies none; - add_header Referrer-Policy no-referrer; - fastcgi_hide_header X-Powered-By; - root /data/config/www/nextcloud/; - # display real ip in nginx logs when connected through reverse proxy via docker network - set_real_ip_from 172.0.0.0/8; - real_ip_header X-Forwarded-For; - location = /robots.txt { - allow all; - log_not_found off; - access_log off; - } - location = /.well-known/carddav { - return 301 $scheme://$host:$server_port/remote.php/dav; - } - location = /.well-known/caldav { - return 301 $scheme://$host:$server_port/remote.php/dav; - } - location = /.well-known/webfinger { - return 301 $scheme://$host:$server_port/public.php?service=webfinger; - } - location = /.well-known/host-meta { - return 301 $scheme://$host:$server_port/public.php?service=host-meta; - } - location = /.well-known/host-meta.json { - return 301 $scheme://$host:$server_port/public.php?service=host-meta-json; - } - client_max_body_size 10G; - fastcgi_buffers 64 4K; - gzip on; - gzip_vary on; - gzip_comp_level 4; - gzip_min_length 256; - gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; - gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; - location / { - rewrite ^ /index.php; - } - location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ { - deny all; - } - location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) { - deny all; - } - location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) { - fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; - set $path_info $fastcgi_path_info; - try_files $fastcgi_script_name =404; - include /etc/nginx/fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $path_info; - fastcgi_param HTTPS on; - fastcgi_param modHeadersAvailable true; - fastcgi_param front_controller_active true; - fastcgi_pass php-handler; - fastcgi_intercept_errors on; - fastcgi_request_buffering off; - } - location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) { - try_files $uri/ =404; - index index.php; - } - location ~ \.(?:css|js|woff2?|svg|gif|map)$ { - try_files $uri /index.php$request_uri; - add_header Cache-Control "public, max-age=15778463"; - # Add headers to serve security related headers - # Before enabling Strict-Transport-Security headers please read into this - # topic first. - #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always; - # - # WARNING: Only add the preload option once you read about - # the consequences in https://hstspreload.org/. This option - # will add the domain to a hardcoded list that is shipped - # in all major browsers and getting removed from this list - # could take several months. - add_header X-Content-Type-Options nosniff; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Robots-Tag none; - add_header X-Download-Options noopen; - add_header X-Frame-Options "SAMEORIGIN"; - add_header X-Permitted-Cross-Domain-Policies none; - add_header Referrer-Policy no-referrer; - access_log off; - } - location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$ { - try_files $uri /index.php$request_uri; - access_log off; - } -} diff --git a/nextcloud/root/defaults/nextcloud-perms.sh b/nextcloud/root/defaults/nextcloud-perms.sh deleted file mode 100644 index 6bf4607f0..000000000 --- a/nextcloud/root/defaults/nextcloud-perms.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -ocpath="${NEXTCLOUD_PATH}" -htuser='abc' -htgroup='abc' -rootuser='root' - -printf "Creating possible missing Directories\n" -mkdir -p $ocpath/data -mkdir -p $ocpath/assets -mkdir -p $ocpath/updater -mkdir -p $ocpath/apps -mkdir -p $ocpath/assets -mkdir -p $ocpath/config -mkdir -p $ocpath/data -mkdir -p $ocpath/themes -mkdir -p /data/config/nextcloud/config -mkdir -p /data/config/nextcloud/data -mkdir -p /data/config/www/nextcloud/occ 2>/dev/null -mkdir -p /share/nextcloud -mkdir -p /ssl/nextcloud/keys - -printf "chmod Files and Directories. This could take some time, please wait...\n" -#chmod -R 777 ${ocpath} -find ${ocpath}/ -type f -exec chmod 0640 {} \; -find ${ocpath}/ -type d -exec chmod 0750 {} \; - -#find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640 -#find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750 - -printf "chown Directories. This could take some time, please wait...\n" -chown -R ${rootuser}:${htgroup} ${ocpath}/ -chown -R ${htuser}:${htgroup} ${ocpath}/apps/ -chown -R ${htuser}:${htgroup} ${ocpath}/assets/ -chown -R ${htuser}:${htgroup} ${ocpath}/config/ -chown -R ${htuser}:${htgroup} ${ocpath}/data/ -chown -R ${htuser}:${htgroup} ${ocpath}/themes/ -chown -R ${htuser}:${htgroup} ${ocpath}/updater/ -chown -R ${htuser}:${htgroup} /share/nextcloud -chown -R ${htuser}:${htgroup} /ssl/nextcloud/keys || true - -chmod +x ${ocpath}/occ - -printf "chmod/chown .htaccess\n" -if [ -f ${ocpath}/.htaccess ] - then - chmod 0644 ${ocpath}/.htaccess - chown ${rootuser}:${htgroup} ${ocpath}/.htaccess -fi -if [ -f ${ocpath}/data/.htaccess ] - then - chmod 0644 ${ocpath}/data/.htaccess - chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess -fi diff --git a/nextcloud/root/defaults/nginx.conf b/nextcloud/root/defaults/nginx.conf deleted file mode 100644 index 9949edc82..000000000 --- a/nextcloud/root/defaults/nginx.conf +++ /dev/null @@ -1,102 +0,0 @@ -## Version 2018/08/16 - Changelog: https://github.com/linuxserver/docker-baseimage-alpine-nginx/commits/master/root/defaults/nginx.conf - -user abc; -worker_processes 4; -pid /run/nginx.pid; -include /etc/nginx/modules/*.conf; - -events { - worker_connections 768; - # multi_accept on; -} - -http { - - ## - # Basic Settings - ## - - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 300; - types_hash_max_size 2048; - fastcgi_read_timeout 86400; - # server_tokens off; - - # server_names_hash_bucket_size 64; - # server_name_in_redirect off; - - client_max_body_size 0; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - ## - # Logging Settings - ## - - access_log /data/config/log/nginx/access.log; - error_log /data/config/log/nginx/error.log; - - ## - # Gzip Settings - ## - - gzip on; - gzip_disable "msie6"; - - # gzip_vary on; - # gzip_proxied any; - # gzip_comp_level 6; - # gzip_buffers 16 8k; - # gzip_http_version 1.1; - # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; - - ## - # nginx-naxsi config - ## - # Uncomment it if you installed nginx-naxsi - ## - - #include /etc/nginx/naxsi_core.rules; - - ## - # nginx-passenger config - ## - # Uncomment it if you installed nginx-passenger - ## - - #passenger_root /usr; - #passenger_ruby /usr/bin/ruby; - - ## - # Virtual Host Configs - ## - include /etc/nginx/conf.d/*.conf; - include /data/config/nginx/site-confs/*; - -} - -#mail { -# # See sample authentication script at: -# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript -# -# # auth_http localhost/auth.php; -# # pop3_capabilities "TOP" "USER"; -# # imap_capabilities "IMAP4rev1" "UIDPLUS"; -# -# server { -# listen localhost:110; -# protocol pop3; -# proxy on; -# } -# -# server { -# listen localhost:143; -# protocol imap; -# proxy on; -# } -#} -daemon off; - diff --git a/nextcloud/root/defaults/root b/nextcloud/root/defaults/root deleted file mode 100644 index 7563168d1..000000000 --- a/nextcloud/root/defaults/root +++ /dev/null @@ -1,9 +0,0 @@ -# do daily/weekly/monthly maintenance -# min hour day month weekday command -*/15 * * * * run-parts /etc/periodic/15min -0 * * * * run-parts /etc/periodic/hourly -0 2 * * * run-parts /etc/periodic/daily -0 3 * * 6 run-parts /etc/periodic/weekly -0 5 1 * * run-parts /etc/periodic/monthly -# nextcloud cron -*/5 * * * * s6-setuidgid abc php7 -f /data/config/www/nextcloud/cron.php diff --git a/nextcloud/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/nextcloud/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index e33f7f063..000000000 --- a/nextcloud/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ -e "/ENVFILE" ]; then - echo "Executing script" - PACKAGES=$(< /ENVFILE) - ( - ####################### - # Automatic installer # - ####################### - $(ls /bin/bash &>/dev/null) || (apt-get install -y --no-install-recommends bash || apk add --no-cache bash) && \ - $(curl --help &>/dev/null) || (apt-get install -y --no-install-recommends curl &>/dev/null || apk add --no-cache curl) && \ - curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \ - chmod 777 /automatic_packages.sh && \ - eval /./automatic_packages.sh "$PACKAGES" && \ - rm /automatic_packages.sh - - ) >/dev/null - -fi diff --git a/nextcloud/root/etc/cont-init.d/00-banner.sh b/nextcloud/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 0ac294e9a..000000000 --- a/nextcloud/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/nextcloud/root/etc/cont-init.d/10-adduser b/nextcloud/root/etc/cont-init.d/10-adduser deleted file mode 100644 index a1207733b..000000000 --- a/nextcloud/root/etc/cont-init.d/10-adduser +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio - -PUID=$(bashio::config "PUID") -PGID=$(bashio::config "PGID") - -groupmod -o -g "$PGID" abc -usermod -o -u "$PUID" abc -mkdir -p /data/config -mkdir -p /share/nextcloud -echo ' -------------------------------------- - _ () - | | ___ _ __ - | | / __| | | / \ - | | \__ \ | | | () | - |_| |___/ |_| \__/ - - -Brought to you by linuxserver.io --------------------------------------' -if [[ -f /donate.txt ]]; then - echo ' -To support the app dev(s) visit:' - cat /donate.txt -fi -echo ' -To support LSIO projects visit: -https://www.linuxserver.io/donate/ -------------------------------------- -GID/UID --------------------------------------' -echo " -User uid: $(id -u abc) -User gid: $(id -g abc) -------------------------------------- -" -chown abc:abc /app -chown abc:abc /data/config -chown abc:abc /defaults diff --git a/nextcloud/root/etc/cont-init.d/30-keygen b/nextcloud/root/etc/cont-init.d/30-keygen deleted file mode 100644 index 2d41156b2..000000000 --- a/nextcloud/root/etc/cont-init.d/30-keygen +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/with-contenv bashio - -if bashio::config.true 'use_own_certs'; then - - bashio::log.info "Using referenced ssl certificates..." - CERTFILE=$(bashio::config 'certfile') - KEYFILE=$(bashio::config 'keyfile') - - #Check if files exist - echo "... checking if referenced files exist" - [ ! -f /ssl/$CERTFILE ] && bashio::log.fatal "... use_own_certs is true but certificate /ssl/$CERTFILE not found" && bashio::exit.nok - [ ! -f /ssl/$KEYFILE ] && bashio::log.fatal "... use_own_certs is true but certificate /ssl/$KEYFILE not found" && bashio::exit.nok - -else - mkdir -p /ssl/nextcloud/keys - bashio::log.info "No ssl certificates set. Auto generating ones..." - SUBJECT="/C=US/ST=CA/L=Carlsbad/O=Linuxserver.io/OU=LSIO Server/CN=*" - openssl req -new -x509 -days 3650 -nodes -out /ssl/nextcloud/keys/cert.crt -keyout /ssl/nextcloud/keys/cert.key -subj "$SUBJECT" - CERTFILE="nextcloud/keys/cert.crt" - KEYFILE="nextcloud/keys/cert.key" - -fi - -#Sets certificates -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) - if [ ! -z $LINE ]; then - sed -i "/ssl_certificate/ d" $NGINXFILE - sed -i "$LINE a ssl_certificate_key /ssl/$KEYFILE;" $NGINXFILE - sed -i "$LINE a ssl_certificate /ssl/$CERTFILE;" $NGINXFILE - fi - fi -done -bashio::log.info "... done" diff --git a/nextcloud/root/etc/cont-init.d/40-config b/nextcloud/root/etc/cont-init.d/40-config deleted file mode 100644 index f63e7eb5b..000000000 --- a/nextcloud/root/etc/cont-init.d/40-config +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/with-contenv bash - -#create folders -mkdir -p \ - /share/nextcloud \ - /data/config/nextcloud/config \ - /data/config/nextcloud/data - -#permissions -chown abc:abc \ - /share/nextcloud \ - /data/config/nextcloud/config \ - /data/config/nextcloud/data - -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/root/etc/cont-init.d/50-install b/nextcloud/root/etc/cont-init.d/50-install deleted file mode 100644 index bd2695198..000000000 --- a/nextcloud/root/etc/cont-init.d/50-install +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/with-contenv bash - -# create folders -mkdir -p \ - "${NEXTCLOUD_PATH}" \ - /data/config/crontabs - -# install app -if [ ! -e "${NEXTCLOUD_PATH}/index.php" ]; then - tar xf /app/nextcloud.tar.bz2 -C \ - "${NEXTCLOUD_PATH}" --strip-components=1 - chown abc:abc -R \ - "${NEXTCLOUD_PATH}" - chmod +x "${NEXTCLOUD_PATH}/occ" -fi - -#?set cronjob -[[ ! -f /data/config/crontabs/root ]] && \ - cp /defaults/root /data/config/crontabs/root -cp /data/config/crontabs/root /etc/crontabs/root - diff --git a/nextcloud/root/etc/cont-init.d/60-memcache b/nextcloud/root/etc/cont-init.d/60-memcache deleted file mode 100644 index 0307c088d..000000000 --- a/nextcloud/root/etc/cont-init.d/60-memcache +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/with-contenv bash - -# copy config -[[ ! -f /data/config/www/nextcloud/config/config.php ]] && \ - cp /defaults/config.php /data/config/www/nextcloud/config/config.php - -# permissions -chown abc:abc \ - /data/config/www/nextcloud/config/config.php diff --git a/nextcloud/root/etc/cont-init.d/99-elasticsearch b/nextcloud/root/etc/cont-init.d/99-elasticsearch deleted file mode 100644 index b87d40798..000000000 --- a/nextcloud/root/etc/cont-init.d/99-elasticsearch +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/with-contenv bashio - -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 - LAUNCHER=$(find / -name "occ" -print -quit) -fi || bashio::log.info "occ not found" - -# Make sure there is an Nextcloud installation -if [[ $($LAUNCHER -V) == *"not installed"* ]]; then - bashio::log.warning "It seems there is no Nextcloud server installed. Please restart the addon after initialization of the user." - exit 0 -fi - -############ -# BASED ON # -################################################################################# -# https://raw.githubusercontent.com/nextcloud/vm/master/apps/fulltextsearch.sh # -# T&M Hansson IT AB © - 2021, https://www.hanssonit.se/ # -# SwITNet Ltd © - 2021, https://switnet.net/ # -################################################################################# - -if bashio::config.true 'Full_Text_Search'; then - if [ $LAUNCHER fulltextsearch:index ] &>/dev/null; then - echo "Full Text Search is already working" - break 2 - fi - - echo "Installing Full Text Search" - # Reset Full Text Search to be able to index again, and also remove the app to be able to install it again - occ fulltextsearch:reset &>/dev/null || true - APPS=(fulltextsearch fulltextsearch_elasticsearch files_fulltextsearch) - for app in "${APPS[@]}"; do - # If app exists, remove it - [ ! -z $($LAUNCHER app:getpath $app) ] && $LAUNCHER app:remove $app &>/dev/null - done - - # Get Full Text Search app for nextcloud - for app in "${APPS[@]}"; do - echo "... installing apps : $app" - $LAUNCHER app:install $app >/dev/null - $LAUNCHER app:enable $app >/dev/null - done - chown -R abc:abc $NEXTCLOUD_PATH/apps - - if bashio::config.has_value 'elasticsearch_server'; then - HOST=$(bashio::config 'elasticsearch_server') - else - bashio::log.warning 'Please define elasticsearch server url in addon options with the format "ip:port" such as "192.168.178.1:9200"' - HOST=$(bashio::network.ipv4_address) - HOST="${HOST%/*}:9200" - fi - - # Final setup - echo "... settings apps" - #occ fulltextsearch:configure '{"search_platform":"ElasticSearchPlatform"}' - $LAUNCHER fulltextsearch_elasticsearch:configure "{\"elastic_host\":\"http://$HOST:9200\"}" &>/dev/null - $LAUNCHER fulltextsearch_elasticsearch:configure "{\"elastic_index\":\"my_index\"}" &>/dev/null - $LAUNCHER fulltextsearch_elasticsearch:configure "{\"analyzer_tokenizer\":\"standard\"}" &>/dev/null - $LAUNCHER fulltextsearch:configure '{"search_platform":"OCA\\FullTextSearch_Elasticsearch\\Platform\\ElasticSearchPlatform"}' &>/dev/null || true - $LAUNCHER files_fulltextsearch:configure "{\"files_pdf\":\"1\",\"files_office\":\"1\"}" &>/dev/null || true - - # Is server detected - # if [ curl $HOST ] &>/dev/null; then - # Wait further for cache for index to work - echo "Waiting for a few seconds before indexing starts..." - sleep 10s - if $LAUNCHER fulltextsearch:index &>/dev/null; then - bashio::log.info "Full Text Search was successfully installed using elasticsearch server $HOST!" - - else - - bashio::log.warning "Elasticsearch can't connect. Please manually define its server in the options" - fi -else - echo "Full_Text_Search option not set" -fi diff --git a/nextcloud/root/etc/cont-init.d/99-ocr b/nextcloud/root/etc/cont-init.d/99-ocr deleted file mode 100644 index 8d5693f82..000000000 --- a/nextcloud/root/etc/cont-init.d/99-ocr +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/with-contenv bashio - -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 - LAUNCHER=$(find / -name "occ" -print -quit) -fi || bashio::log.info "occ not found" - -# Make sure there is an Nextcloud installation -if [[ $($LAUNCHER -V) == *"not installed"* ]]; then - bashio::log.warning "It seems there is no Nextcloud server installed. Please restart the addon after initialization of the user." - exit 0 -fi - -# Install OCR if requested -if bashio::config.has_value 'OCR'; then - # Install package - if $(bashio::config 'OCR') = true; then - - # Get Full Text Search app for nextcloud - echo "... installing apps : fulltextsearch" - occ app:install files_fulltextsearch_tesseract &>/dev/null || true - occ app:enable files_fulltextsearch_tesseract &>/dev/null || true - - echo "Installing OCR" - apk add --quiet --no-cache tesseract-ocr || apk add --quiet --no-cache tesseract-ocr@community - # Install additional language if requested - if bashio::config.has_value 'OCRLANG'; then - LANG=$(bashio::config 'OCRLANG') - apk add --quiet --no-cache tesseract-ocr-data-$LANG || apk add --quiet --no-cache tesseract-ocr-data-$LANG@community && \ - 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 - sudo rm -r $LANG.traineddata &>/dev/null || true - wget https://github.com/tesseract-ocr/tessdata/raw/main/$LANG.traineddata &>/dev/null - - fi - elif $(bashio::config 'OCR') = false; then - bashio::log.info 'Removing OCR' - # Delete package - apk del tesseract-ocr.* &>/dev/null || true - # Remove app - occ app:disable files_fulltextsearch_tesseract &>/dev/null || true - fi -fi diff --git a/nextcloud/root/etc/cont-init.d/99-trusted_domains b/nextcloud/root/etc/cont-init.d/99-trusted_domains deleted file mode 100644 index 59036b0a9..000000000 --- a/nextcloud/root/etc/cont-init.d/99-trusted_domains +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/with-contenv bashio - -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 - LAUNCHER=$(find / -name "occ" -print -quit) -fi || bashio::log.info "occ not found" - -# Make sure there is an Nextcloud installation -if [[ $($LAUNCHER -V) == *"not installed"* ]]; then - bashio::log.warning "It seems there is no Nextcloud server installed. Please restart the addon after initialization of the user." - exit 0 -fi - -#################### -# Initialization # -#################### - -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)" - i=2 - until [ $i -gt 5 ]; do - $LAUNCHER config:system:delete trusted_domains $i && \ - ((i = i + 1)) || exit - done - - ########################### - # Add new trusted domains # - ########################### - TRUSTEDDOMAINS=$(bashio::config 'trusted_domains') - bashio::log.info "... alignement with trusted domains list : ${TRUSTEDDOMAINS}" - for domain in ${TRUSTEDDOMAINS//,/ }; do # Comma separated values - bashio::log.info "... adding ${domain}" - $LAUNCHER config:system:set trusted_domains $i --value=${domain} - i=$((i + 1)) - done - - bashio::log.info "Remaining configurated trusted domains :" - bashio::log.info "$($LAUNCHER config:system:get trusted_domains)" || exit - -fi diff --git a/nextcloud/root/etc/services.d/cron/run b/nextcloud/root/etc/services.d/cron/run deleted file mode 100644 index a1b27f4a7..000000000 --- a/nextcloud/root/etc/services.d/cron/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/with-contenv bash - -/usr/sbin/crond -f -S -l 0 -c /etc/crontabs diff --git a/organizr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/organizr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/organizr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/organizr/root/etc/cont-init.d/00-banner.sh b/organizr/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 0ac294e9a..000000000 --- a/organizr/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/organizr/root/etc/cont-init.d/00-folders b/organizr/root/etc/cont-init.d/00-folders deleted file mode 100644 index 73c65e4d3..000000000 --- a/organizr/root/etc/cont-init.d/00-folders +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/with-contenv bash - -if [ ! -d /data/organizr ]; then - echo "Creating /data/organizr" - mkdir -p /data/organizr - chown -R abc:abc /data/organizr -fi diff --git a/organizr/root/etc/cont-init.d/00-ha-env b/organizr/root/etc/cont-init.d/00-ha-env deleted file mode 100644 index 3b3e69246..000000000 --- a/organizr/root/etc/cont-init.d/00-ha-env +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bashio - -for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do - printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k -done \ No newline at end of file diff --git a/plex/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/plex/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/plex/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/plex/root/etc/cont-init.d/00-banner.sh b/plex/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 0ac294e9a..000000000 --- a/plex/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/plex/root/etc/cont-init.d/21-folders b/plex/root/etc/cont-init.d/21-folders deleted file mode 100644 index afb2a6707..000000000 --- a/plex/root/etc/cont-init.d/21-folders +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/with-contenv bash - -################## -# SYMLINK CONFIG # -################## - -echo "Database stored in /share/plex" - -if [ ! -d "/share/plex/Plex Media Server" ]; then -echo "... creating /share/plex/Plex Media Server" -mkdir -p "/share/plex/Plex Media Server" -fi - -if [ -d "/config/Library/Application Support/Plex Media Server" ]; then - echo "... creating /symlink" - rm -r "/config/Library/Application Support/*" - ln -s "/share/plex/Plex Media Server" "/config/Library/Application Support" -fi - -if [ ! -d "/config/Library/Application Support" ]; then - echo "... creating /symlink" - mkdir -p "/config/Library/Application Support" - ln -s "/share/plex/Plex Media Server" "/config/Library/Application Support" -fi - -chown -R abc:abc /share/plex diff --git a/plex/root/etc/cont-init.d/90-create_links b/plex/root/etc/cont-init.d/90-create_links deleted file mode 100644 index 8cca2b550..000000000 --- a/plex/root/etc/cont-init.d/90-create_links +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/with-contenv bash - -################## -# SYMLINK CONFIG # -################## - -if [ ! -d /share/plex ]; then - echo "Creating /share/plex" - mkdir -p /share/plex - chown -R abc:abc /share/plex -else - chown -R abc:abc /share/plex -fi - -if [ ! -d /share/plex/Library ]; then - echo "moving Library folder" - mv /config/Library /share/plex - ln -s /share/plex/Library /config - echo "links done" -else - rm -r /config/Library - ln -s /share/plex/Library /config - echo "Using existing config" -fi diff --git a/plex/root/etc/cont-init.d/92-local_mounts.sh b/plex/root/etc/cont-init.d/92-local_mounts.sh deleted file mode 100644 index 0920d68bd..000000000 --- a/plex/root/etc/cont-init.d/92-local_mounts.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/with-contenv bashio - -###################### -# MOUNT LOCAL SHARES # -###################### - -# Mount local Share if configured -if bashio::config.has_value 'localdisks'; then - - MOREDISKS=$(bashio::config 'localdisks') - echo "Local Disks mounting..." - - # Separate comma separated values - for disk in ${MOREDISKS//,/ }; do - - # Mount by device as default - devpath=/dev - - # Mount as label - [ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label - - # Creates dir - mkdir -p /mnt/$disk - chown -R $(id -u):$(id -g) /mnt/$disk - # Legacy mounting : mount to share if still exists (avoid breaking changes) - [ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true - # Mount - mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk) - - done - -fi diff --git a/plex/root/etc/cont-init.d/92-smb_mounts.sh b/plex/root/etc/cont-init.d/92-smb_mounts.sh deleted file mode 100644 index 06410e554..000000000 --- a/plex/root/etc/cont-init.d/92-smb_mounts.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/with-contenv bashio - -######################### -# MOUNT SMB SHARES v1.6 # -######################### -if bashio::config.has_value 'networkdisks'; then - - # Define variables - MOREDISKS=$(bashio::config 'networkdisks') - CIFS_USERNAME=$(bashio::config 'cifsusername') - CIFS_PASSWORD=$(bashio::config 'cifspassword') - MOUNTED=false - SMBVERS="" - SECVERS="" - - # Mount CIFS Share if configured and if Protection Mode is active - echo 'Mounting smb share(s)...' - - if bashio::config.has_value 'cifsdomain'; then - DOMAIN=",domain=$(bashio::config 'cifsdomain')" - else - DOMAIN="" - fi - - # Mounting disks - for disk in ${MOREDISKS//,/ }; do # Separate comma separated values - - # Clean name of network share - disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name - diskname=${disk//\\//} #replace \ with / - diskname=${diskname##*/} # Get only last part of the name - - # Data validation - if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then - bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future." - exit 0 - fi - - # Prepare mount point - mkdir -p /mnt/$diskname - chown -R root:root /mnt/$diskname - - #Tries to mount with default options - mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false - - # if Fail test different smb and sec versions - if [ $MOUNTED = false ]; then - for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false - for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false - done - done - fi - - # Messages - if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then - #Test write permissions - touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && - bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || - bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw" - - else - # Mounting failed messages - bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" - bashio::log.fatal "Here is some debugging info :" - - # Provide debugging info - smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client - #smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - - # Error code - bashio::log.fatal "Error read : $(/dev/null || true - rmdir /mnt/$diskname || true - fi - - done -fi diff --git a/prowlarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/prowlarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/prowlarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/prowlarr/root/etc/cont-init.d/00-banner.sh b/prowlarr/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 0ac294e9a..000000000 --- a/prowlarr/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/prowlarr/root/etc/cont-init.d/00-ha-env b/prowlarr/root/etc/cont-init.d/00-ha-env deleted file mode 100644 index 3b3e69246..000000000 --- a/prowlarr/root/etc/cont-init.d/00-ha-env +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bashio - -for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do - printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k -done \ No newline at end of file diff --git a/prowlarr/root/etc/cont-init.d/20-folders b/prowlarr/root/etc/cont-init.d/20-folders deleted file mode 100644 index a40d5c92e..000000000 --- a/prowlarr/root/etc/cont-init.d/20-folders +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/with-contenv bash - -if [ ! -d /config/prowlarr ]; then - echo "Creating /config/radarr" - mkdir -p /config/prowlarr - chown -R abc:abc /config/prowlarr -fi diff --git a/prowlarr/root/etc/cont-init.d/92-smb_mounts.sh b/prowlarr/root/etc/cont-init.d/92-smb_mounts.sh deleted file mode 100644 index 06410e554..000000000 --- a/prowlarr/root/etc/cont-init.d/92-smb_mounts.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/with-contenv bashio - -######################### -# MOUNT SMB SHARES v1.6 # -######################### -if bashio::config.has_value 'networkdisks'; then - - # Define variables - MOREDISKS=$(bashio::config 'networkdisks') - CIFS_USERNAME=$(bashio::config 'cifsusername') - CIFS_PASSWORD=$(bashio::config 'cifspassword') - MOUNTED=false - SMBVERS="" - SECVERS="" - - # Mount CIFS Share if configured and if Protection Mode is active - echo 'Mounting smb share(s)...' - - if bashio::config.has_value 'cifsdomain'; then - DOMAIN=",domain=$(bashio::config 'cifsdomain')" - else - DOMAIN="" - fi - - # Mounting disks - for disk in ${MOREDISKS//,/ }; do # Separate comma separated values - - # Clean name of network share - disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name - diskname=${disk//\\//} #replace \ with / - diskname=${diskname##*/} # Get only last part of the name - - # Data validation - if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then - bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future." - exit 0 - fi - - # Prepare mount point - mkdir -p /mnt/$diskname - chown -R root:root /mnt/$diskname - - #Tries to mount with default options - mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false - - # if Fail test different smb and sec versions - if [ $MOUNTED = false ]; then - for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false - for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false - done - done - fi - - # Messages - if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then - #Test write permissions - touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && - bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || - bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw" - - else - # Mounting failed messages - bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" - bashio::log.fatal "Here is some debugging info :" - - # Provide debugging info - smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client - #smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - - # Error code - bashio::log.fatal "Error read : $(/dev/null || true - rmdir /mnt/$diskname || true - fi - - done -fi diff --git a/radarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/radarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/radarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/radarr/root/etc/cont-init.d/00-banner.sh b/radarr/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 0ac294e9a..000000000 --- a/radarr/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/radarr/root/etc/cont-init.d/00-ha-env b/radarr/root/etc/cont-init.d/00-ha-env deleted file mode 100644 index d0b511f60..000000000 --- a/radarr/root/etc/cont-init.d/00-ha-env +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bashio - -for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do - printf "$(bashio::config $k)" >/var/run/s6/container_environment/$k -done diff --git a/radarr/root/etc/cont-init.d/20-folders b/radarr/root/etc/cont-init.d/20-folders deleted file mode 100644 index 9fcadd756..000000000 --- a/radarr/root/etc/cont-init.d/20-folders +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/with-contenv bash - -if [ ! -d /share/storage/movies ]; then - echo "Creating /share/storage/movies" - mkdir -p /share/storage/movies - chown -R abc:abc /share/storage/movies -fi - -if [ ! -d /share/downloads ]; then - echo "Creating /share/downloads" - mkdir -p /share/downloads - chown -R abc:abc /share/downloads -fi - -if [ ! -d /config/radarr ]; then - echo "Creating /config/radarr" - mkdir -p /config/radarr - chown -R abc:abc /config/radarr -fi diff --git a/radarr/root/etc/cont-init.d/92-local_mounts.sh b/radarr/root/etc/cont-init.d/92-local_mounts.sh deleted file mode 100644 index 0920d68bd..000000000 --- a/radarr/root/etc/cont-init.d/92-local_mounts.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/with-contenv bashio - -###################### -# MOUNT LOCAL SHARES # -###################### - -# Mount local Share if configured -if bashio::config.has_value 'localdisks'; then - - MOREDISKS=$(bashio::config 'localdisks') - echo "Local Disks mounting..." - - # Separate comma separated values - for disk in ${MOREDISKS//,/ }; do - - # Mount by device as default - devpath=/dev - - # Mount as label - [ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label - - # Creates dir - mkdir -p /mnt/$disk - chown -R $(id -u):$(id -g) /mnt/$disk - # Legacy mounting : mount to share if still exists (avoid breaking changes) - [ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true - # Mount - mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk) - - done - -fi diff --git a/radarr/root/etc/cont-init.d/92-smb_mounts.sh b/radarr/root/etc/cont-init.d/92-smb_mounts.sh deleted file mode 100644 index 06410e554..000000000 --- a/radarr/root/etc/cont-init.d/92-smb_mounts.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/with-contenv bashio - -######################### -# MOUNT SMB SHARES v1.6 # -######################### -if bashio::config.has_value 'networkdisks'; then - - # Define variables - MOREDISKS=$(bashio::config 'networkdisks') - CIFS_USERNAME=$(bashio::config 'cifsusername') - CIFS_PASSWORD=$(bashio::config 'cifspassword') - MOUNTED=false - SMBVERS="" - SECVERS="" - - # Mount CIFS Share if configured and if Protection Mode is active - echo 'Mounting smb share(s)...' - - if bashio::config.has_value 'cifsdomain'; then - DOMAIN=",domain=$(bashio::config 'cifsdomain')" - else - DOMAIN="" - fi - - # Mounting disks - for disk in ${MOREDISKS//,/ }; do # Separate comma separated values - - # Clean name of network share - disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name - diskname=${disk//\\//} #replace \ with / - diskname=${diskname##*/} # Get only last part of the name - - # Data validation - if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then - bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future." - exit 0 - fi - - # Prepare mount point - mkdir -p /mnt/$diskname - chown -R root:root /mnt/$diskname - - #Tries to mount with default options - mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false - - # if Fail test different smb and sec versions - if [ $MOUNTED = false ]; then - for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false - for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false - done - done - fi - - # Messages - if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then - #Test write permissions - touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && - bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || - bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw" - - else - # Mounting failed messages - bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" - bashio::log.fatal "Here is some debugging info :" - - # Provide debugging info - smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client - #smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - - # Error code - bashio::log.fatal "Error read : $(/dev/null || true - rmdir /mnt/$diskname || true - fi - - done -fi diff --git a/requestrr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/requestrr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/requestrr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/requestrr/root/etc/cont-init.d/00-banner.sh b/requestrr/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 0ac294e9a..000000000 --- a/requestrr/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/requestrr/root/etc/cont-init.d/00-ha-env b/requestrr/root/etc/cont-init.d/00-ha-env deleted file mode 100644 index 342068f41..000000000 --- a/requestrr/root/etc/cont-init.d/00-ha-env +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bashio - -for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do - printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k -done diff --git a/sonarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/sonarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/sonarr/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/sonarr/root/etc/cont-init.d/00-banner.sh b/sonarr/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 0ac294e9a..000000000 --- a/sonarr/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/sonarr/root/etc/cont-init.d/00-ha-env b/sonarr/root/etc/cont-init.d/00-ha-env deleted file mode 100644 index 3b3e69246..000000000 --- a/sonarr/root/etc/cont-init.d/00-ha-env +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bashio - -for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do - printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k -done \ No newline at end of file diff --git a/sonarr/root/etc/cont-init.d/20-folders b/sonarr/root/etc/cont-init.d/20-folders deleted file mode 100644 index 17b3689df..000000000 --- a/sonarr/root/etc/cont-init.d/20-folders +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/with-contenv bash - -if [ ! -d /share/storage/movies ]; then - echo "Creating /share/storage/movies" - mkdir -p /share/storage/movies - chown -R abc:abc /share/storage/movies -fi - -if [ ! -d /share/downloads ]; then - echo "Creating /share/downloads" - mkdir -p /share/downloads - chown -R abc:abc /share/downloads -fi - -if [ ! -d /config/sonarr ]; then - echo "Creating /config/sonarr" - mkdir -p /config/sonarr - chown -R abc:abc /config/sonarr -fi diff --git a/sonarr/root/etc/cont-init.d/92-local_mounts.sh b/sonarr/root/etc/cont-init.d/92-local_mounts.sh deleted file mode 100644 index 0920d68bd..000000000 --- a/sonarr/root/etc/cont-init.d/92-local_mounts.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/with-contenv bashio - -###################### -# MOUNT LOCAL SHARES # -###################### - -# Mount local Share if configured -if bashio::config.has_value 'localdisks'; then - - MOREDISKS=$(bashio::config 'localdisks') - echo "Local Disks mounting..." - - # Separate comma separated values - for disk in ${MOREDISKS//,/ }; do - - # Mount by device as default - devpath=/dev - - # Mount as label - [ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label - - # Creates dir - mkdir -p /mnt/$disk - chown -R $(id -u):$(id -g) /mnt/$disk - # Legacy mounting : mount to share if still exists (avoid breaking changes) - [ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true - # Mount - mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk) - - done - -fi diff --git a/sonarr/root/etc/cont-init.d/92-smb_mounts.sh b/sonarr/root/etc/cont-init.d/92-smb_mounts.sh deleted file mode 100644 index 06410e554..000000000 --- a/sonarr/root/etc/cont-init.d/92-smb_mounts.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/with-contenv bashio - -######################### -# MOUNT SMB SHARES v1.6 # -######################### -if bashio::config.has_value 'networkdisks'; then - - # Define variables - MOREDISKS=$(bashio::config 'networkdisks') - CIFS_USERNAME=$(bashio::config 'cifsusername') - CIFS_PASSWORD=$(bashio::config 'cifspassword') - MOUNTED=false - SMBVERS="" - SECVERS="" - - # Mount CIFS Share if configured and if Protection Mode is active - echo 'Mounting smb share(s)...' - - if bashio::config.has_value 'cifsdomain'; then - DOMAIN=",domain=$(bashio::config 'cifsdomain')" - else - DOMAIN="" - fi - - # Mounting disks - for disk in ${MOREDISKS//,/ }; do # Separate comma separated values - - # Clean name of network share - disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name - diskname=${disk//\\//} #replace \ with / - diskname=${diskname##*/} # Get only last part of the name - - # Data validation - if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then - bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future." - exit 0 - fi - - # Prepare mount point - mkdir -p /mnt/$diskname - chown -R root:root /mnt/$diskname - - #Tries to mount with default options - mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false - - # if Fail test different smb and sec versions - if [ $MOUNTED = false ]; then - for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false - for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false - done - done - fi - - # Messages - if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then - #Test write permissions - touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && - bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || - bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw" - - else - # Mounting failed messages - bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" - bashio::log.fatal "Here is some debugging info :" - - # Provide debugging info - smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client - #smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - - # Error code - bashio::log.fatal "Error read : $(/dev/null || true - rmdir /mnt/$diskname || true - fi - - done -fi diff --git a/webtop/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh b/webtop/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh deleted file mode 100644 index 612e26d7e..000000000 --- a/webtop/root/etc/cont-init.d/00-aaa_dockerfile_backup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# If dockerfile failed install manually -if [ ! -f "/usr/bin/bashio" ]; then - echo "Bashio does not exist, executing script" - ( - ################ - # Install apps # - ################ - PACKAGES="${PACKAGES:="curl"}" - - apt-get clean \ - && apt-get update \ - && apt-get install -y --no-install-recommends ${PACKAGES} 2>/dev/null \ - || apk add --no-cache ${PACKAGES} - - ################### - # Install bashio # - ################## - - mkdir -p /tmp/bashio - curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | - tar -xzf - --strip 1 -C /tmp/bashio - mv /tmp/bashio/lib /usr/lib/bashio - ln -s /usr/lib/bashio/bashio /usr/bin/bashio - rm -rf /tmp/bashio - - ) >/dev/null - -fi diff --git a/webtop/root/etc/cont-init.d/00-banner.sh b/webtop/root/etc/cont-init.d/00-banner.sh deleted file mode 100644 index 0ac294e9a..000000000 --- a/webtop/root/etc/cont-init.d/00-banner.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Displays a simple add-on banner on startup -# ============================================================================== - -if bashio::supervisor.ping; then - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue " Add-on: $(bashio::addon.name)" - bashio::log.blue " $(bashio::addon.description)" - bashio::log.blue \ - '-----------------------------------------------------------' - - bashio::log.blue " Add-on version: $(bashio::addon.version)" - if bashio::var.true "$(bashio::addon.update_available)"; then - bashio::log.magenta ' There is an update available for this add-on!' - bashio::log.magenta \ - " Latest add-on version: $(bashio::addon.version_latest)" - bashio::log.magenta ' Please consider upgrading as soon as possible.' - else - bashio::log.green ' You are running the latest version of this add-on.' - fi - - bashio::log.blue " System: $(bashio::info.operating_system)" \ - " ($(bashio::info.arch) / $(bashio::info.machine))" - bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)" - bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)" - - bashio::log.blue \ - '-----------------------------------------------------------' - bashio::log.blue \ - ' Please, share the above information when looking for help' - bashio::log.blue \ - ' or support in, e.g., GitHub, forums' - bashio::log.green \ - ' https://github.com/alexbelgium/hassio-addons' - bashio::log.blue \ - '-----------------------------------------------------------' -fi diff --git a/webtop/root/etc/cont-init.d/90-dns_set.sh b/webtop/root/etc/cont-init.d/90-dns_set.sh deleted file mode 100644 index dd80ef417..000000000 --- a/webtop/root/etc/cont-init.d/90-dns_set.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/with-contenv bashio - -############### -# DNS SETTING # -############### - -# 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="" - - # Get DNS servers - for server in ${DNSSERVER//,/ } # Separate comma separated values - do - 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" -else - bashio::log.info "DNS Servers option empty. Using default router (or HA) dns servers." -fi diff --git a/webtop/root/etc/cont-init.d/92-local_mounts.sh b/webtop/root/etc/cont-init.d/92-local_mounts.sh deleted file mode 100644 index 0920d68bd..000000000 --- a/webtop/root/etc/cont-init.d/92-local_mounts.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/with-contenv bashio - -###################### -# MOUNT LOCAL SHARES # -###################### - -# Mount local Share if configured -if bashio::config.has_value 'localdisks'; then - - MOREDISKS=$(bashio::config 'localdisks') - echo "Local Disks mounting..." - - # Separate comma separated values - for disk in ${MOREDISKS//,/ }; do - - # Mount by device as default - devpath=/dev - - # Mount as label - [ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label - - # Creates dir - mkdir -p /mnt/$disk - chown -R $(id -u):$(id -g) /mnt/$disk - # Legacy mounting : mount to share if still exists (avoid breaking changes) - [ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true - # Mount - mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk) - - done - -fi diff --git a/webtop/root/etc/cont-init.d/92-smb_mounts.sh b/webtop/root/etc/cont-init.d/92-smb_mounts.sh deleted file mode 100644 index 06410e554..000000000 --- a/webtop/root/etc/cont-init.d/92-smb_mounts.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/with-contenv bashio - -######################### -# MOUNT SMB SHARES v1.6 # -######################### -if bashio::config.has_value 'networkdisks'; then - - # Define variables - MOREDISKS=$(bashio::config 'networkdisks') - CIFS_USERNAME=$(bashio::config 'cifsusername') - CIFS_PASSWORD=$(bashio::config 'cifspassword') - MOUNTED=false - SMBVERS="" - SECVERS="" - - # Mount CIFS Share if configured and if Protection Mode is active - echo 'Mounting smb share(s)...' - - if bashio::config.has_value 'cifsdomain'; then - DOMAIN=",domain=$(bashio::config 'cifsdomain')" - else - DOMAIN="" - fi - - # Mounting disks - for disk in ${MOREDISKS//,/ }; do # Separate comma separated values - - # Clean name of network share - disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name - diskname=${disk//\\//} #replace \ with / - diskname=${diskname##*/} # Get only last part of the name - - # Data validation - if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then - bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future." - exit 0 - fi - - # Prepare mount point - mkdir -p /mnt/$diskname - chown -R root:root /mnt/$diskname - - #Tries to mount with default options - mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false - - # if Fail test different smb and sec versions - if [ $MOUNTED = false ]; then - for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN:-WORKGROUP}"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false - for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"; do - mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false - done - done - fi - - # Messages - if [ $MOUNTED = true ] && [ "mountpoint -q /mnt/$diskname" ]; then - #Test write permissions - touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && - bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || - bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw" - - else - # Mounting failed messages - bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" - bashio::log.fatal "Here is some debugging info :" - - # Provide debugging info - smbclient -V &>/dev/null || apt-get install smbclient || apk add --no-cache samba-client - #smbclient $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD || true - - # Error code - bashio::log.fatal "Error read : $(/dev/null || true - rmdir /mnt/$diskname || true - fi - - done -fi