Apply beautysh changes

Apply beautysh changes
This commit is contained in:
Alexandre
2022-03-16 10:58:23 +01:00
committed by GitHub
146 changed files with 2017 additions and 2017 deletions

View File

@@ -12,10 +12,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -26,9 +26,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -13,18 +13,18 @@ JSONSOURCE="/data/options.json"
mapfile -t arr < <(jq -r 'keys[]' "${JSONSOURCE}") mapfile -t arr < <(jq -r 'keys[]' "${JSONSOURCE}")
for KEYS in "${arr[@]}"; do for KEYS in "${arr[@]}"; do
# export key # export key
VALUE=$(jq ."$KEYS" "${JSONSOURCE}") VALUE=$(jq ."$KEYS" "${JSONSOURCE}")
line="${KEYS}='${VALUE//[\"\']/}'" line="${KEYS}='${VALUE//[\"\']/}'"
# Use locally # Use locally
if bashio::config.false "verbose" || [[ "${KEYS}" == *"PASS"* ]]; then if bashio::config.false "verbose" || [[ "${KEYS}" == *"PASS"* ]]; then
bashio::log.blue "${KEYS}=******" bashio::log.blue "${KEYS}=******"
else else
bashio::log.blue "$line" bashio::log.blue "$line"
fi fi
# Export the variable to run scripts # Export the variable to run scripts
if cat /etc/services.d/*/*run* &>/dev/null; then sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null; fi if cat /etc/services.d/*/*run* &>/dev/null; then sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null; fi
if cat /etc/cont-init.d/*run* &>/dev/null; then sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null; fi if cat /etc/cont-init.d/*run* &>/dev/null; then sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null; fi
done done
################ ################
@@ -32,8 +32,8 @@ done
################ ################
set +e set +e
if [ -n "$TZ" ] && [ -f /etc/localtime ]; then if [ -n "$TZ" ] && [ -f /etc/localtime ]; then
if [ -f /usr/share/zoneinfo/"$TZ" ]; then if [ -f /usr/share/zoneinfo/"$TZ" ]; then
echo "Timezone set from $(cat /etc/timezone) to $TZ" echo "Timezone set from $(cat /etc/timezone) to $TZ"
ln -snf /usr/share/zoneinfo/"$TZ" /etc/localtime && echo "$TZ" >/etc/timezone ln -snf /usr/share/zoneinfo/"$TZ" /etc/localtime && echo "$TZ" >/etc/timezone
fi fi
fi fi

View File

@@ -68,11 +68,11 @@ function parse_yaml {
local prefix=$2 || local prefix="" local prefix=$2 || local prefix=""
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @ | tr @ '\034') local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @ | tr @ '\034')
sed -ne "s|^\($s\):|\1|" \ sed -ne "s|^\($s\):|\1|" \
-e "s| #.*$||g" \ -e "s| #.*$||g" \
-e "s|#.*$||g" \ -e "s|#.*$||g" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \ -e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{ awk -F$fs '{
indent = length($1)/2; indent = length($1)/2;
vname[indent] = $2; vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}} for (i in vname) {if (i > indent) {delete vname[i]}}
@@ -80,7 +80,7 @@ function parse_yaml {
vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("_")} vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("_")}
printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, $2, $3); printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, $2, $3);
} }
}' }'
} }
# Get variables and export # Get variables and export

View File

@@ -8,23 +8,23 @@
# Avoid usage of local dns such as adguard home or pihole\n" # Avoid usage of local dns such as adguard home or pihole\n"
if bashio::config.has_value 'DNS_server'; then if bashio::config.has_value 'DNS_server'; then
# Define variables # Define variables
DNSSERVER=$(bashio::config 'DNS_server') DNSSERVER=$(bashio::config 'DNS_server')
DNS="" DNS=""
DNSLIST="" DNSLIST=""
# Get DNS servers # Get DNS servers
# shellcheck disable=SC2086 # shellcheck disable=SC2086
for server in ${DNSSERVER//,/ }; do # Separate comma separated values for server in ${DNSSERVER//,/ }; do # Separate comma separated values
DNS="${DNS}nameserver $server\n" DNS="${DNS}nameserver $server\n"
DNSLIST="$server $DNSLIST" DNSLIST="$server $DNSLIST"
done done
# Write resolv.conf # Write resolv.conf
# shellcheck disable=SC2059 # shellcheck disable=SC2059
printf "${DNS}" >/etc/resolv.conf printf "${DNS}" >/etc/resolv.conf
chmod 644 /etc/resolv.conf chmod 644 /etc/resolv.conf
bashio::log.info "DNS SERVERS set to $DNSLIST" bashio::log.info "DNS SERVERS set to $DNSLIST"
else else
bashio::log.info "DNS Servers option empty. Using default router (or HA) dns servers." bashio::log.info "DNS Servers option empty. Using default router (or HA) dns servers."
fi fi

View File

@@ -8,29 +8,29 @@
# Mount local Share if configured # Mount local Share if configured
if bashio::config.has_value 'localdisks'; then if bashio::config.has_value 'localdisks'; then
MOREDISKS=$(bashio::config 'localdisks') MOREDISKS=$(bashio::config 'localdisks')
echo "Local Disks mounting..." echo "Local Disks mounting..."
# Separate comma separated values # Separate comma separated values
# shellcheck disable=SC2086 # shellcheck disable=SC2086
for disk in ${MOREDISKS//,/ }; do for disk in ${MOREDISKS//,/ }; do
# Mount by device as default # Mount by device as default
devpath=/dev devpath=/dev
# Mount as label # Mount as label
[ "${disk:0:2}" != "sd" ] && devpath=/dev/disk/by-label [ "${disk:0:2}" != "sd" ] && devpath=/dev/disk/by-label
# Creates dir # Creates dir
mkdir -p /mnt/"$disk" mkdir -p /mnt/"$disk"
chown -R "$(id -u)":"$(id -g)" /mnt/"$disk" chown -R "$(id -u)":"$(id -g)" /mnt/"$disk"
# Legacy mounting : mount to share if still exists (avoid breaking changes) # Legacy mounting : mount to share if still exists (avoid breaking changes)
# shellcheck disable=SC2015 # shellcheck disable=SC2015
[ -d /share/"$disk" ] && mount "$devpath"/"$disk" /share/"$disk" || true [ -d /share/"$disk" ] && mount "$devpath"/"$disk" /share/"$disk" || true
# Mount # Mount
# shellcheck disable=SC2015 # shellcheck disable=SC2015
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) 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 done
fi fi

View File

@@ -7,83 +7,83 @@
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
# Define variables # Define variables
MOREDISKS=$(bashio::config 'networkdisks') MOREDISKS=$(bashio::config 'networkdisks')
CIFS_USERNAME=$(bashio::config 'cifsusername') CIFS_USERNAME=$(bashio::config 'cifsusername')
CIFS_PASSWORD=$(bashio::config 'cifspassword') CIFS_PASSWORD=$(bashio::config 'cifspassword')
MOUNTED=false MOUNTED=false
SMBVERS="" SMBVERS=""
SECVERS="" SECVERS=""
# Mount CIFS Share if configured and if Protection Mode is active # Mount CIFS Share if configured and if Protection Mode is active
echo 'Mounting smb share(s)...' echo 'Mounting smb share(s)...'
if bashio::config.has_value 'cifsdomain'; then
DOMAIN=",domain=$(bashio::config 'cifsdomain')"
else
DOMAIN=""
fi
# Mounting disks
# shellcheck disable=SC2086
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share
# shellcheck disable=SC2116,SC2001
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
# shellcheck disable=SC2140
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
# shellcheck disable=SC2015
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"
if bashio::config.has_value 'cifsdomain'; then
DOMAIN=",domain=$(bashio::config 'cifsdomain')"
else else
# Mounting failed messages DOMAIN=""
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 : $(<ERRORCODE)"
rm ERRORCODE
# clean folder
umount "/mnt/$diskname" 2>/dev/null || true
rmdir "/mnt/$diskname" || true
fi fi
done # Mounting disks
# shellcheck disable=SC2086
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share
# shellcheck disable=SC2116,SC2001
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
# shellcheck disable=SC2140
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
# shellcheck disable=SC2015
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 : $(<ERRORCODE)"
rm ERRORCODE
# clean folder
umount "/mnt/$diskname" 2>/dev/null || true
rmdir "/mnt/$diskname" || true
fi
done
fi fi

View File

@@ -4,5 +4,5 @@ CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION")
CONFIGSOURCE="$(dirname "${CONFIGSOURCE}")" CONFIGSOURCE="$(dirname "${CONFIGSOURCE}")"
if [ -f "$CONFIGSOURCE"/script.sh ]; then if [ -f "$CONFIGSOURCE"/script.sh ]; then
"$CONFIGSOURCE"./script.sh "$CONFIGSOURCE"./script.sh
fi fi

View File

@@ -149,7 +149,7 @@ for packagestoinstall in $PACKAGES; do
[ "$VERBOSE" = true ] && echo "... $packagestoinstall" [ "$VERBOSE" = true ] && echo "... $packagestoinstall"
if [ "$PACKMANAGER" = "apk" ]; then if [ "$PACKMANAGER" = "apk" ]; then
apk add --no-cache "$packagestoinstall" &>/dev/null || (echo "Error : $packagestoinstall not found" && touch /ERROR) apk add --no-cache "$packagestoinstall" &>/dev/null || (echo "Error : $packagestoinstall not found" && touch /ERROR)
elif [ "$PACKMANAGER" = "apt" ]; then elif [ "$PACKMANAGER" = "apt" ]; then
apt-get install -yqq --no-install-recommends "$packagestoinstall" &>/dev/null || (echo "Error : $packagestoinstall not found" && touch /ERROR) apt-get install -yqq --no-install-recommends "$packagestoinstall" &>/dev/null || (echo "Error : $packagestoinstall not found" && touch /ERROR)
fi fi
[ "$VERBOSE" = true ] && echo "... $packagestoinstall done" [ "$VERBOSE" = true ] && echo "... $packagestoinstall done"

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -23,156 +23,156 @@ git config --system user.password "${GITPASS}"
git config --system user.email "${GITMAIL}" git config --system user.email "${GITMAIL}"
if bashio::config.has_value 'gitapi'; then if bashio::config.has_value 'gitapi'; then
LOGINFO="... setting github API" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi LOGINFO="... setting github API" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
GITHUB_API_TOKEN=$(bashio::config 'gitapi') GITHUB_API_TOKEN=$(bashio::config 'gitapi')
export GITHUB_API_TOKEN export GITHUB_API_TOKEN
fi fi
LOGINFO="... parse addons" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi LOGINFO="... parse addons" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
for addons in $(bashio::config "addon|keys"); do for addons in $(bashio::config "addon|keys"); do
SLUG=$(bashio::config "addon[${addons}].slug") SLUG=$(bashio::config "addon[${addons}].slug")
REPOSITORY=$(bashio::config "addon[${addons}].repository") REPOSITORY=$(bashio::config "addon[${addons}].repository")
UPSTREAM=$(bashio::config "addon[${addons}].upstream") UPSTREAM=$(bashio::config "addon[${addons}].upstream")
BETA=$(bashio::config "addon[${addons}].beta") BETA=$(bashio::config "addon[${addons}].beta")
FULLTAG=$(bashio::config "addon[${addons}].fulltag") FULLTAG=$(bashio::config "addon[${addons}].fulltag")
HAVINGASSET=$(bashio::config "addon[${addons}].having_asset") HAVINGASSET=$(bashio::config "addon[${addons}].having_asset")
SOURCE=$(bashio::config "addon[${addons}].source") SOURCE=$(bashio::config "addon[${addons}].source")
FILTER_TEXT=$(bashio::config "addon[${addons}].filter") FILTER_TEXT=$(bashio::config "addon[${addons}].filter")
BASENAME=$(basename "https://github.com/$REPOSITORY") BASENAME=$(basename "https://github.com/$REPOSITORY")
DATE="$(date '+%d-%m-%Y')" DATE="$(date '+%d-%m-%Y')"
#Create or update local version #Create or update local version
if [ ! -d "/data/$BASENAME" ]; then if [ ! -d "/data/$BASENAME" ]; then
LOGINFO="... $SLUG : cloning ${REPOSITORY}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi LOGINFO="... $SLUG : cloning ${REPOSITORY}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
cd /data/ || exit cd /data/ || exit
git clone "https://github.com/${REPOSITORY}" git clone "https://github.com/${REPOSITORY}"
else
LOGINFO="... $SLUG : updating ${REPOSITORY}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
cd "/data/$BASENAME" || exit
git pull --rebase &>/dev/null || git reset --hard &>/dev/null
git pull --rebase &>/dev/null
fi
#Define the folder addon
LOGINFO="... $SLUG : checking slug exists in repo" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
cd /data/"${BASENAME}"/"${SLUG}" || bashio::log.error "$SLUG addon not found in this repository. Exiting. Exiting."
#Find current version
LOGINFO="... $SLUG : get current version" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
CURRENT=$(jq .upstream config.json) || bashio::log.error "$SLUG addon upstream tag not found in config.json. Exiting."
if [ "$SOURCE" = "dockerhub" ]; then
# Use dockerhub as upstream
# shellcheck disable=SC2116
DOCKERHUB_REPO=$(echo "${UPSTREAM%%/*}")
DOCKERHUB_IMAGE=$(echo "$UPSTREAM" | cut -d "/" -f2)
LASTVERSION=$(
curl -f -L -s --fail "https://hub.docker.com/v2/repositories/${DOCKERHUB_REPO}/${DOCKERHUB_IMAGE}/tags/?page_size=10" |
jq '.results | .[] | .name' -r |
sed -e '/.*latest.*/d' |
sed -e '/.*dev.*/d' |
sort -V |
tail -n 1
)
[ "${BETA}" = true ] &&
LASTVERSION=$(
curl -f -L -s --fail "https://hub.docker.com/v2/repositories/${DOCKERHUB_REPO}/${DOCKERHUB_IMAGE}/tags/?page_size=10" |
jq '.results | .[] | .name' -r |
sed -e '/.*latest.*/d' |
sed -e '/.*dev.*/!d' |
sort -V |
tail -n 1
)
else
# Use github as upstream
ARGUMENTS=""
#Prepare tag flag
if [ "${FULLTAG}" = true ]; then
LOGINFO="... $SLUG : fulltag is on" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
ARGUMENTS="$ARGUMENTS --format tag"
else else
LOGINFO="... $SLUG : fulltag is off" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi LOGINFO="... $SLUG : updating ${REPOSITORY}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
cd "/data/$BASENAME" || exit
git pull --rebase &>/dev/null || git reset --hard &>/dev/null
git pull --rebase &>/dev/null
fi fi
#Prepare tag flag #Define the folder addon
if [ "${HAVINGASSET}" = true ]; then LOGINFO="... $SLUG : checking slug exists in repo" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
LOGINFO="... $SLUG : asset_only tag is on" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi cd /data/"${BASENAME}"/"${SLUG}" || bashio::log.error "$SLUG addon not found in this repository. Exiting. Exiting."
ARGUMENTS="$ARGUMENTS --having-asset"
#Find current version
LOGINFO="... $SLUG : get current version" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
CURRENT=$(jq .upstream config.json) || bashio::log.error "$SLUG addon upstream tag not found in config.json. Exiting."
if [ "$SOURCE" = "dockerhub" ]; then
# Use dockerhub as upstream
# shellcheck disable=SC2116
DOCKERHUB_REPO=$(echo "${UPSTREAM%%/*}")
DOCKERHUB_IMAGE=$(echo "$UPSTREAM" | cut -d "/" -f2)
LASTVERSION=$(
curl -f -L -s --fail "https://hub.docker.com/v2/repositories/${DOCKERHUB_REPO}/${DOCKERHUB_IMAGE}/tags/?page_size=10" |
jq '.results | .[] | .name' -r |
sed -e '/.*latest.*/d' |
sed -e '/.*dev.*/d' |
sort -V |
tail -n 1
)
[ "${BETA}" = true ] &&
LASTVERSION=$(
curl -f -L -s --fail "https://hub.docker.com/v2/repositories/${DOCKERHUB_REPO}/${DOCKERHUB_IMAGE}/tags/?page_size=10" |
jq '.results | .[] | .name' -r |
sed -e '/.*latest.*/d' |
sed -e '/.*dev.*/!d' |
sort -V |
tail -n 1
)
else else
LOGINFO="... $SLUG : asset_only is off" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi # Use github as upstream
ARGUMENTS=""
#Prepare tag flag
if [ "${FULLTAG}" = true ]; then
LOGINFO="... $SLUG : fulltag is on" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
ARGUMENTS="$ARGUMENTS --format tag"
else
LOGINFO="... $SLUG : fulltag is off" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
fi
#Prepare tag flag
if [ "${HAVINGASSET}" = true ]; then
LOGINFO="... $SLUG : asset_only tag is on" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
ARGUMENTS="$ARGUMENTS --having-asset"
else
LOGINFO="... $SLUG : asset_only is off" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
fi
#Prepare tag flag
if [ "${FILTER_TEXT}" = "null" ] || [ "${FILTER_TEXT}" = "" ]; then
FILTER_TEXT=""
else
LOGINFO="... $SLUG : filter_text is on" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
ARGUMENTS="$ARGUMENTS --only $FILTER_TEXT"
fi
#If beta flag, select beta version
if [ "${BETA}" = true ]; then
LOGINFO="... $SLUG : beta is on" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
# shellcheck disable=SC2086
LASTVERSION=$(lastversion --pre "https://github.com/$UPSTREAM" $ARGUMENTS) || break
else
LOGINFO="... $SLUG : beta is off" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
# shellcheck disable=SC2086
LASTVERSION=$(lastversion "https://github.com/$UPSTREAM" $ARGUMENTS) || break
fi
fi fi
#Prepare tag flag # Add brackets
if [ "${FILTER_TEXT}" = "null" ] || [ "${FILTER_TEXT}" = "" ]; then LASTVERSION='"'${LASTVERSION}'"'
FILTER_TEXT=""
# Do not compare with ls tag for linuxserver images (to avoid updating only for dependencies)
#LASTVERSION2=${LASTVERSION%-ls*}
#CURRENT2=${CURRENT%-ls*}
LASTVERSION2=${LASTVERSION}
CURRENT2=${CURRENT}
# Update if needed
if [ "${CURRENT2}" != "${LASTVERSION2}" ]; then
LOGINFO="... $SLUG : update from ${CURRENT} to ${LASTVERSION}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
#Change all instances of version
LOGINFO="... $SLUG : updating files" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
for files in "config.json" "config.yaml" "Dockerfile" "build.json" "build.yaml";do
if [ -f /data/"${BASENAME}"/"${SLUG}"/$files ]; then
sed -i "s/${CURRENT}/${LASTVERSION}/g" /data/"${BASENAME}"/"${SLUG}"/"$files"
fi
done
# Remove " and modify version
LASTVERSION=${LASTVERSION//\"/}
CURRENT=${CURRENT//\"/}
jq --arg variable "$LASTVERSION" '.version = $variable' /data/"${BASENAME}"/"${SLUG}"/config.json | sponge /data/"${BASENAME}"/"${SLUG}"/config.json # Replace version tag
#Update changelog
touch "/data/${BASENAME}/${SLUG}/CHANGELOG.md"
sed -i "1i - Update to latest version from $UPSTREAM" "/data/${BASENAME}/${SLUG}/CHANGELOG.md"
sed -i "1i ## ${LASTVERSION} (${DATE})" "/data/${BASENAME}/${SLUG}/CHANGELOG.md"
sed -i "1i " "/data/${BASENAME}/${SLUG}/CHANGELOG.md"
LOGINFO="... $SLUG : files updated" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
#Git commit and push
git add -A # add all modified files
git commit -m "Updater bot : $SLUG updated to ${LASTVERSION}" >/dev/null
LOGINFO="... $SLUG : push to github" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
git remote set-url origin "https://${GITUSER}:${GITPASS}@github.com/${REPOSITORY}" &>/dev/null
git push &>/dev/null
#Log
bashio::log.yellow "... $SLUG updated from ${CURRENT} to ${LASTVERSION}"
else else
LOGINFO="... $SLUG : filter_text is on" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi bashio::log.green "... $SLUG is up-to-date ${CURRENT}"
ARGUMENTS="$ARGUMENTS --only $FILTER_TEXT"
fi fi
#If beta flag, select beta version
if [ "${BETA}" = true ]; then
LOGINFO="... $SLUG : beta is on" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
# shellcheck disable=SC2086
LASTVERSION=$(lastversion --pre "https://github.com/$UPSTREAM" $ARGUMENTS) || break
else
LOGINFO="... $SLUG : beta is off" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
# shellcheck disable=SC2086
LASTVERSION=$(lastversion "https://github.com/$UPSTREAM" $ARGUMENTS) || break
fi
fi
# Add brackets
LASTVERSION='"'${LASTVERSION}'"'
# Do not compare with ls tag for linuxserver images (to avoid updating only for dependencies)
#LASTVERSION2=${LASTVERSION%-ls*}
#CURRENT2=${CURRENT%-ls*}
LASTVERSION2=${LASTVERSION}
CURRENT2=${CURRENT}
# Update if needed
if [ "${CURRENT2}" != "${LASTVERSION2}" ]; then
LOGINFO="... $SLUG : update from ${CURRENT} to ${LASTVERSION}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
#Change all instances of version
LOGINFO="... $SLUG : updating files" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
for files in "config.json" "config.yaml" "Dockerfile" "build.json" "build.yaml";do
if [ -f /data/"${BASENAME}"/"${SLUG}"/$files ]; then
sed -i "s/${CURRENT}/${LASTVERSION}/g" /data/"${BASENAME}"/"${SLUG}"/"$files"
fi
done
# Remove " and modify version
LASTVERSION=${LASTVERSION//\"/}
CURRENT=${CURRENT//\"/}
jq --arg variable "$LASTVERSION" '.version = $variable' /data/"${BASENAME}"/"${SLUG}"/config.json | sponge /data/"${BASENAME}"/"${SLUG}"/config.json # Replace version tag
#Update changelog
touch "/data/${BASENAME}/${SLUG}/CHANGELOG.md"
sed -i "1i - Update to latest version from $UPSTREAM" "/data/${BASENAME}/${SLUG}/CHANGELOG.md"
sed -i "1i ## ${LASTVERSION} (${DATE})" "/data/${BASENAME}/${SLUG}/CHANGELOG.md"
sed -i "1i " "/data/${BASENAME}/${SLUG}/CHANGELOG.md"
LOGINFO="... $SLUG : files updated" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
#Git commit and push
git add -A # add all modified files
git commit -m "Updater bot : $SLUG updated to ${LASTVERSION}" >/dev/null
LOGINFO="... $SLUG : push to github" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
git remote set-url origin "https://${GITUSER}:${GITPASS}@github.com/${REPOSITORY}" &>/dev/null
git push &>/dev/null
#Log
bashio::log.yellow "... $SLUG updated from ${CURRENT} to ${LASTVERSION}"
else
bashio::log.green "... $SLUG is up-to-date ${CURRENT}"
fi
done done
bashio::log.info "Addons update completed" bashio::log.info "Addons update completed"

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -1,33 +1,33 @@
#!/bin/bash #!/bin/bash
if [ ! -d /share/storage/movies ]; then if [ ! -d /share/storage/movies ]; then
echo "Creating /share/storage/movies" echo "Creating /share/storage/movies"
mkdir -p /share/storage/movies mkdir -p /share/storage/movies
chown -R abc:abc /share/storage/movies chown -R abc:abc /share/storage/movies
fi fi
if [ ! -d /share/storage/tv ]; then if [ ! -d /share/storage/tv ]; then
echo "Creating /share/storage/tv" echo "Creating /share/storage/tv"
mkdir -p /share/storage/tv mkdir -p /share/storage/tv
chown -R abc:abc /share/storage/tv chown -R abc:abc /share/storage/tv
fi fi
if [ ! -d /share/downloads ]; then if [ ! -d /share/downloads ]; then
echo "Creating /share/downloads" echo "Creating /share/downloads"
mkdir -p /share/downloads mkdir -p /share/downloads
chown -R abc:abc /share/downloads chown -R abc:abc /share/downloads
fi fi
if [ -d /config/bazarr ] && [ ! -d /config/addons_config/bazarr ]; then if [ -d /config/bazarr ] && [ ! -d /config/addons_config/bazarr ]; then
echo "Moving to new location /config/addons_config/bazarr" echo "Moving to new location /config/addons_config/bazarr"
mkdir -p /config/addons_config/bazarr mkdir -p /config/addons_config/bazarr
chown -R abc:abc /config/addons_config/bazarr chown -R abc:abc /config/addons_config/bazarr
mv /config/bazarr/* /config/addons_config/bazarr/ mv /config/bazarr/* /config/addons_config/bazarr/
rm -r /config/bazarr rm -r /config/bazarr
fi fi
if [ ! -d /config/addons_config/bazarr ]; then if [ ! -d /config/addons_config/bazarr ]; then
echo "Creating /config/addons_config/bazarr" echo "Creating /config/addons_config/bazarr"
mkdir -p /config/addons_config/bazarr mkdir -p /config/addons_config/bazarr
chown -R abc:abc /config/addons_config/bazarr chown -R abc:abc /config/addons_config/bazarr
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -16,8 +16,8 @@ export CLOUDCMD_PREFIX
declare ADDON_PROTOCOL=http declare ADDON_PROTOCOL=http
if bashio::config.true 'ssl'; then if bashio::config.true 'ssl'; then
ADDON_PROTOCOL=https ADDON_PROTOCOL=https
bashio::config.require.ssl bashio::config.require.ssl
fi fi
# port=$(bashio::addon.port 80) # port=$(bashio::addon.port 80)
@@ -34,15 +34,15 @@ mkdir -p /var/log/nginx && touch /var/log/nginx/error.log
############### ###############
if bashio::config.has_value 'CUSTOM_OPTIONS'; then if bashio::config.has_value 'CUSTOM_OPTIONS'; then
CUSTOMOPTIONS=" $(bashio::config 'CUSTOM_OPTIONS')" CUSTOMOPTIONS=" $(bashio::config 'CUSTOM_OPTIONS')"
else else
CUSTOMOPTIONS="" CUSTOMOPTIONS=""
fi fi
if bashio::config.has_value 'DROPBOX_TOKEN'; then if bashio::config.has_value 'DROPBOX_TOKEN'; then
DROPBOX_TOKEN="--dropbox --dropbox-token $(bashio::config 'DROPBOX_TOKEN')" DROPBOX_TOKEN="--dropbox --dropbox-token $(bashio::config 'DROPBOX_TOKEN')"
else else
DROPBOX_TOKEN="" DROPBOX_TOKEN=""
fi fi
bashio::log.info "Starting..." bashio::log.info "Starting..."

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -1,90 +1,90 @@
#!/bin/bash #!/bin/bash
if [ ! -d /emby ]; then if [ ! -d /emby ]; then
echo "Creating /emby" echo "Creating /emby"
mkdir -p /emby mkdir -p /emby
chown -R abc:abc /emby chown -R abc:abc /emby
fi fi
if [ ! -d /share/storage/tv ]; then if [ ! -d /share/storage/tv ]; then
echo "Creating /share/storage/tv" echo "Creating /share/storage/tv"
mkdir -p /share/storage/tv mkdir -p /share/storage/tv
chown -R abc:abc /share/storage/tv chown -R abc:abc /share/storage/tv
fi fi
if [ ! -d /share/storage/movies ]; then if [ ! -d /share/storage/movies ]; then
echo "Creating /share/storage/movies" echo "Creating /share/storage/movies"
mkdir -p /share/storage/movies mkdir -p /share/storage/movies
chown -R abc:abc /share/storage/movies chown -R abc:abc /share/storage/movies
fi fi
if [ ! -d /share/emby ]; then if [ ! -d /share/emby ]; then
echo "Creating /share/emby" echo "Creating /share/emby"
mkdir -p /share/emby mkdir -p /share/emby
chown -R abc:abc /share/emby chown -R abc:abc /share/emby
fi fi
if [ -d /config/emby ] && [ ! -d /config/addons_config/emby ]; then if [ -d /config/emby ] && [ ! -d /config/addons_config/emby ]; then
echo "Moving to new location /config/addons_config/emby" echo "Moving to new location /config/addons_config/emby"
mkdir -p /config/addons_config/emby mkdir -p /config/addons_config/emby
chown -R abc:abc /config/addons_config/emby chown -R abc:abc /config/addons_config/emby
mv /config/emby/* /config/addons_config/emby/ mv /config/emby/* /config/addons_config/emby/
rm -r /config/emby rm -r /config/emby
fi fi
if [ ! -d /config/addons_config/emby ]; then if [ ! -d /config/addons_config/emby ]; then
echo "Creating /config/addons_config/emby" echo "Creating /config/addons_config/emby"
mkdir -p /config/addons_config/emby mkdir -p /config/addons_config/emby
chown -R abc:abc /config/addons_config/emby chown -R abc:abc /config/addons_config/emby
fi fi
# links # links
if [ ! -d /emby/cache ]; then if [ ! -d /emby/cache ]; then
echo "Creating link for /emby/cache" echo "Creating link for /emby/cache"
mkdir -p /share/emby/cache mkdir -p /share/emby/cache
chown -R abc:abc /share/emby/cache chown -R abc:abc /share/emby/cache
ln -s /share/emby/cache /emby/cache ln -s /share/emby/cache /emby/cache
fi fi
if [ ! -d /emby/config ]; then if [ ! -d /emby/config ]; then
echo "Creating link for /emby/config" echo "Creating link for /emby/config"
mkdir -p /config/emby mkdir -p /config/emby
chown -R abc:abc /config/emby chown -R abc:abc /config/emby
ln -s /config/emby /emby/config ln -s /config/emby /emby/config
fi fi
if [ ! -d /emby/data ]; then if [ ! -d /emby/data ]; then
echo "Creating link for /emby/data" echo "Creating link for /emby/data"
mkdir -p /share/emby/data mkdir -p /share/emby/data
chown -R abc:abc /share/emby/data chown -R abc:abc /share/emby/data
ln -s /share/emby/data /emby/data ln -s /share/emby/data /emby/data
fi fi
if [ ! -d /emby/logs ]; then if [ ! -d /emby/logs ]; then
echo "Creating link for /emby/logs" echo "Creating link for /emby/logs"
mkdir -p /share/emby/logs mkdir -p /share/emby/logs
chown -R abc:abc /share/emby/logs chown -R abc:abc /share/emby/logs
ln -s /share/emby/logs /emby/logs ln -s /share/emby/logs /emby/logs
fi fi
if [ ! -d /emby/metadata ]; then if [ ! -d /emby/metadata ]; then
echo "Creating link for /emby/metadata" echo "Creating link for /emby/metadata"
mkdir -p /share/emby/metadata mkdir -p /share/emby/metadata
chown -R abc:abc /share/emby/metadata chown -R abc:abc /share/emby/metadata
ln -s /share/emby/metadata /emby/metadata ln -s /share/emby/metadata /emby/metadata
fi fi
if [ ! -d /emby/plugins ]; then if [ ! -d /emby/plugins ]; then
echo "Creating link for /emby/plugins" echo "Creating link for /emby/plugins"
mkdir -p /share/emby/plugins mkdir -p /share/emby/plugins
chown -R abc:abc /share/emby/plugins chown -R abc:abc /share/emby/plugins
ln -s /share/emby/plugins /emby/plugins ln -s /share/emby/plugins /emby/plugins
fi fi
if [ ! -d /emby/root ]; then if [ ! -d /emby/root ]; then
echo "Creating link for /emby/root" echo "Creating link for /emby/root"
mkdir -p /share/emby/root mkdir -p /share/emby/root
chown -R abc:abc /share/emby/root chown -R abc:abc /share/emby/root
ln -s /share/emby/root /emby/root ln -s /share/emby/root /emby/root
fi fi

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -15,33 +15,33 @@ mkdir -p "$(dirname "${DATABASESOURCE}")"
# Check absence of config file # Check absence of config file
if [ -f /data/config.yaml ] && [ ! -L /data/config.yaml ]; then if [ -f /data/config.yaml ] && [ ! -L /data/config.yaml ]; then
bashio::log.warning "A current config was found in /data, it is backuped to ${CONFIGSOURCE}.bak" bashio::log.warning "A current config was found in /data, it is backuped to ${CONFIGSOURCE}.bak"
mv /data/config.yaml "$CONFIGSOURCE".bak mv /data/config.yaml "$CONFIGSOURCE".bak
fi fi
# Check if config file is there, or create one from template # Check if config file is there, or create one from template
if [ -f "$CONFIGSOURCE" ]; then if [ -f "$CONFIGSOURCE" ]; then
# Create symlink if not existing yet # Create symlink if not existing yet
[ ! -L /data/config.yaml ] && ln -sf "$CONFIGSOURCE" /data [ ! -L /data/config.yaml ] && ln -sf "$CONFIGSOURCE" /data
bashio::log.info "Using config file found in $CONFIGSOURCE" bashio::log.info "Using config file found in $CONFIGSOURCE"
# Check if yaml is valid # Check if yaml is valid
EXIT_CODE=0 EXIT_CODE=0
yamllint -d relaxed "$CONFIGSOURCE" &>ERROR || EXIT_CODE=$? yamllint -d relaxed "$CONFIGSOURCE" &>ERROR || EXIT_CODE=$?
if [ "$EXIT_CODE" = 0 ]; then if [ "$EXIT_CODE" = 0 ]; then
echo "Config file is a valid yaml" echo "Config file is a valid yaml"
else else
cat ERROR cat ERROR
bashio::log.fatal "Config file has an invalid yaml format. Please check the file in $CONFIGSOURCE. Errors list above. You can check yaml validity with the online tool yamllint.com" bashio::log.fatal "Config file has an invalid yaml format. Please check the file in $CONFIGSOURCE. Errors list above. You can check yaml validity with the online tool yamllint.com"
bashio::exit.nok bashio::exit.nok
fi fi
else else
# Create symlink for addon to create config # Create symlink for addon to create config
touch "${CONFIGSOURCE}" touch "${CONFIGSOURCE}"
ln -sf "$CONFIGSOURCE" /data ln -sf "$CONFIGSOURCE" /data
rm "$CONFIGSOURCE" rm "$CONFIGSOURCE"
# Need to restart # Need to restart
bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting." bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting."
fi fi
# Remove previous link or file # Remove previous link or file
@@ -49,14 +49,14 @@ fi
# Check if database is here or create symlink # Check if database is here or create symlink
if [ -f "$DATABASESOURCE" ]; then if [ -f "$DATABASESOURCE" ]; then
# Create symlink if not existing yet # Create symlink if not existing yet
ln -sf "${DATABASESOURCE}" /data && echo "creating symlink" ln -sf "${DATABASESOURCE}" /data && echo "creating symlink"
bashio::log.info "Using database file found in $DATABASESOURCE" bashio::log.info "Using database file found in $DATABASESOURCE"
else else
# Create symlink for addon to create database # Create symlink for addon to create database
touch "${DATABASESOURCE}" touch "${DATABASESOURCE}"
ln -sf "$DATABASESOURCE" /data ln -sf "$DATABASESOURCE" /data
rm "$DATABASESOURCE" rm "$DATABASESOURCE"
fi fi
############## ##############
@@ -69,10 +69,10 @@ echo " "
# Test mode # Test mode
TZ=$(bashio::config "TZ") TZ=$(bashio::config "TZ")
if [ "$TZ" = "test" ]; then if [ "$TZ" = "test" ]; then
echo "secret mode found, launching script in /config/test.sh" echo "secret mode found, launching script in /config/test.sh"
cd /config || exit cd /config || exit
chmod 777 test.sh chmod 777 test.sh
./test.sh ./test.sh
fi fi
python -u /app/main.py || bashio::log.fatal "The app has crashed. Are you sure you entered the correct config options?" python -u /app/main.py || bashio::log.fatal "The app has crashed. Are you sure you entered the correct config options?"

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -15,33 +15,33 @@ mkdir -p "$(dirname "${DATABASESOURCE}")"
# Check absence of config file # Check absence of config file
if [ -f /data/config.yaml ] && [ ! -L /data/config.yaml ]; then if [ -f /data/config.yaml ] && [ ! -L /data/config.yaml ]; then
bashio::log.warning "A current config was found in /data, it is backuped to ${CONFIGSOURCE}.bak" bashio::log.warning "A current config was found in /data, it is backuped to ${CONFIGSOURCE}.bak"
mv /data/config.yaml "$CONFIGSOURCE".bak mv /data/config.yaml "$CONFIGSOURCE".bak
fi fi
# Check if config file is there, or create one from template # Check if config file is there, or create one from template
if [ -f "$CONFIGSOURCE" ]; then if [ -f "$CONFIGSOURCE" ]; then
# Create symlink if not existing yet # Create symlink if not existing yet
[ ! -L /data/config.yaml ] && ln -sf "$CONFIGSOURCE" /data [ ! -L /data/config.yaml ] && ln -sf "$CONFIGSOURCE" /data
bashio::log.info "Using config file found in $CONFIGSOURCE" bashio::log.info "Using config file found in $CONFIGSOURCE"
# Check if yaml is valid # Check if yaml is valid
EXIT_CODE=0 EXIT_CODE=0
yamllint -d relaxed "$CONFIGSOURCE" &>ERROR || EXIT_CODE=$? yamllint -d relaxed "$CONFIGSOURCE" &>ERROR || EXIT_CODE=$?
if [ "$EXIT_CODE" = 0 ]; then if [ "$EXIT_CODE" = 0 ]; then
echo "Config file is a valid yaml" echo "Config file is a valid yaml"
else else
cat ERROR cat ERROR
bashio::log.fatal "Config file has an invalid yaml format. Please check the file in $CONFIGSOURCE. Errors list above. You can check yaml validity with the online tool yamllint.com" bashio::log.fatal "Config file has an invalid yaml format. Please check the file in $CONFIGSOURCE. Errors list above. You can check yaml validity with the online tool yamllint.com"
bashio::exit.nok bashio::exit.nok
fi fi
else else
# Create symlink for addon to create config # Create symlink for addon to create config
touch "${CONFIGSOURCE}" touch "${CONFIGSOURCE}"
ln -sf "$CONFIGSOURCE" /data ln -sf "$CONFIGSOURCE" /data
rm "$CONFIGSOURCE" rm "$CONFIGSOURCE"
# Need to restart # Need to restart
bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting." bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting."
fi fi
# Remove previous link or file # Remove previous link or file
@@ -49,14 +49,14 @@ fi
# Check if database is here or create symlink # Check if database is here or create symlink
if [ -f "$DATABASESOURCE" ]; then if [ -f "$DATABASESOURCE" ]; then
# Create symlink if not existing yet # Create symlink if not existing yet
ln -sf "${DATABASESOURCE}" /data && echo "creating symlink" ln -sf "${DATABASESOURCE}" /data && echo "creating symlink"
bashio::log.info "Using database file found in $DATABASESOURCE" bashio::log.info "Using database file found in $DATABASESOURCE"
else else
# Create symlink for addon to create database # Create symlink for addon to create database
touch "${DATABASESOURCE}" touch "${DATABASESOURCE}"
ln -sf "$DATABASESOURCE" /data ln -sf "$DATABASESOURCE" /data
rm "$DATABASESOURCE" rm "$DATABASESOURCE"
fi fi
############## ##############
@@ -69,10 +69,10 @@ echo " "
# Test mode # Test mode
TZ=$(bashio::config "TZ") TZ=$(bashio::config "TZ")
if [ "$TZ" = "test" ]; then if [ "$TZ" = "test" ]; then
echo "secret mode found, launching script in /config/test.sh" echo "secret mode found, launching script in /config/test.sh"
cd /config || exit cd /config || exit
chmod 777 test.sh chmod 777 test.sh
./test.sh ./test.sh
fi fi
python -u /app/main.py || bashio::log.fatal "The app has crashed. Are you sure you entered the correct config options?" python -u /app/main.py || bashio::log.fatal "The app has crashed. Are you sure you entered the correct config options?"

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -2,15 +2,15 @@
# shellcheck shell=bash # shellcheck shell=bash
if [ -d /config/filebrowser ]; then if [ -d /config/filebrowser ]; then
echo "Moving to new location /config/addons_config/filebrowser" echo "Moving to new location /config/addons_config/filebrowser"
mkdir -p /config/addons_config/filebrowser mkdir -p /config/addons_config/filebrowser
chmod 777 /config/addons_config/filebrowser chmod 777 /config/addons_config/filebrowser
mv /config/filebrowser/* /config/addons_config/filebrowser/ mv /config/filebrowser/* /config/addons_config/filebrowser/
rm -r /config/filebrowser rm -r /config/filebrowser
fi fi
if [ ! -d /config/addons_config/filebrowser ]; then if [ ! -d /config/addons_config/filebrowser ]; then
echo "Creating /config/addons_config/filebrowser" echo "Creating /config/addons_config/filebrowser"
mkdir -p /config/addons_config/filebrowser mkdir -p /config/addons_config/filebrowser
chmod 777 /config/addons_config/filebrowser chmod 777 /config/addons_config/filebrowser
fi fi

View File

@@ -7,13 +7,13 @@
bashio::config.require.ssl bashio::config.require.ssl
if bashio::config.true 'ssl'; then if bashio::config.true 'ssl'; then
bashio::log.info "ssl enabled. If webui don't work, disable ssl or check your certificate paths" bashio::log.info "ssl enabled. If webui don't work, disable ssl or check your certificate paths"
#set variables #set variables
CERTFILE="-t /ssl/$(bashio::config 'certfile')" CERTFILE="-t /ssl/$(bashio::config 'certfile')"
KEYFILE="-k /ssl/$(bashio::config 'keyfile')" KEYFILE="-k /ssl/$(bashio::config 'keyfile')"
else else
CERTFILE="" CERTFILE=""
KEYFILE="" KEYFILE=""
fi fi
################# #################
@@ -32,7 +32,7 @@ export FB_BASEURL
declare ADDON_PROTOCOL=http declare ADDON_PROTOCOL=http
# Generate Ingress configuration # Generate Ingress configuration
if bashio::config.true 'ssl'; then if bashio::config.true 'ssl'; then
ADDON_PROTOCOL=https ADDON_PROTOCOL=https
fi fi
#port=$(bashio::addon.port 80) #port=$(bashio::addon.port 80)
@@ -51,28 +51,28 @@ mkdir -p /var/log/nginx && touch /var/log/nginx/error.log
NOAUTH="" NOAUTH=""
if bashio::config.true 'NoAuth'; then if bashio::config.true 'NoAuth'; then
if ! bashio::fs.file_exists "/data/noauth"; then if ! bashio::fs.file_exists "/data/noauth"; then
rm /data/auth &>/dev/null || true rm /data/auth &>/dev/null || true
rm /config/addons_config/filebrowser/filebrowser.dB &>/dev/null || true rm /config/addons_config/filebrowser/filebrowser.dB &>/dev/null || true
touch /data/noauth touch /data/noauth
NOAUTH="--noauth" NOAUTH="--noauth"
bashio::log.warning "Auth method change, database reset" bashio::log.warning "Auth method change, database reset"
fi fi
bashio::log.info "NoAuth option selected" bashio::log.info "NoAuth option selected"
else else
if ! bashio::fs.file_exists "/data/auth"; then if ! bashio::fs.file_exists "/data/auth"; then
rm /data/noauth &>/dev/null || true rm /data/noauth &>/dev/null || true
rm /config/addons_config/filebrowser/filebrowser.dB &>/dev/null || true rm /config/addons_config/filebrowser/filebrowser.dB &>/dev/null || true
touch /data/auth touch /data/auth
bashio::log.warning "Auth method change, database reset" bashio::log.warning "Auth method change, database reset"
fi fi
bashio::log.info "Default username/password : admin/admin" bashio::log.info "Default username/password : admin/admin"
fi fi
if bashio::config.has_value 'base_folder'; then if bashio::config.has_value 'base_folder'; then
BASE_FOLDER=$(bashio::config 'base_folder') BASE_FOLDER=$(bashio::config 'base_folder')
else else
BASE_FOLDER=/ BASE_FOLDER=/
fi fi
bashio::log.info "Starting..." bashio::log.info "Starting..."

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -11,8 +11,8 @@ APP_KEY="$(bashio::config 'APP_KEY')"
# If not base64 # If not base64
if [[ ! "$APP_KEY" == *"base64"* ]]; then if [[ ! "$APP_KEY" == *"base64"* ]]; then
# Check APP_KEY format # Check APP_KEY format
if [ ! "${#APP_KEY}" = 32 ]; then bashio::exit.nok "Your APP_KEY has ${#APP_KEY} instead of 32 characters"; fi if [ ! "${#APP_KEY}" = 32 ]; then bashio::exit.nok "Your APP_KEY has ${#APP_KEY} instead of 32 characters"; fi
fi fi
# Backup APP_KEY file # Backup APP_KEY file
@@ -42,82 +42,82 @@ chmod -R 775 /config/addons_config/fireflyiii
bashio::log.info "Defining database" bashio::log.info "Defining database"
case $(bashio::config 'DB_CONNECTION') in case $(bashio::config 'DB_CONNECTION') in
# Use sqlite # Use sqlite
sqlite_internal) sqlite_internal)
bashio::log.info "Using built in sqlite" bashio::log.info "Using built in sqlite"
# Set variable # Set variable
export DB_CONNECTION=sqlite export DB_CONNECTION=sqlite
# Creating folders # Creating folders
mkdir -p /config/addons_config/fireflyiii/database mkdir -p /config/addons_config/fireflyiii/database
chown -R www-data:www-data /config/addons_config/fireflyiii/database chown -R www-data:www-data /config/addons_config/fireflyiii/database
# Creating database # Creating database
if [ ! -f /config/addons_config/fireflyiii/database/database.sqlite ]; then if [ ! -f /config/addons_config/fireflyiii/database/database.sqlite ]; then
# Create database # Create database
touch /config/addons_config/fireflyiii/database/database.sqlite touch /config/addons_config/fireflyiii/database/database.sqlite
# Install database # Install database
echo "updating database" echo "updating database"
php artisan migrate:refresh --seed --quiet php artisan migrate:refresh --seed --quiet
php artisan firefly-iii:upgrade-database --quiet php artisan firefly-iii:upgrade-database --quiet
php artisan passport:install --quiet php artisan passport:install --quiet
fi
# Creating symlink
rm -r /var/www/html/storage/database
ln -s /config/addons_config/fireflyiii/database /var/www/html/storage/database
# Updating permissions
chmod 775 /config/addons_config/fireflyiii/database/database.sqlite
chown -R www-data:www-data /config/addons_config/fireflyiii
chown -R www-data:www-data /var/www/html/storage
;;
# Use MariaDB
mariadb_addon)
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Detecting values..."
if ! bashio::services.available 'mysql'; then
bashio::log.fatal \
"Local database access should be provided by the MariaDB addon"
bashio::exit.nok \
"Please ensure it is installed and started"
fi
# Use values
DB_CONNECTION=mysql
DB_HOST=$(bashio::services "mysql" "host")
DB_PORT=$(bashio::services "mysql" "port")
DB_DATABASE=firefly
DB_USERNAME=$(bashio::services "mysql" "username")
DB_PASSWORD=$(bashio::services "mysql" "password")
export DB_CONNECTION
export DB_HOST && bashio::log.blue "DB_HOST=$DB_HOST"
export DB_PORT && bashio::log.blue "DB_PORT=$DB_PORT"
export DB_DATABASE && bashio::log.blue "DB_DATABASE=$DB_DATABASE"
export DB_USERNAME && bashio::log.blue "DB_USERNAME=$DB_USERNAME"
export DB_PASSWORD && bashio::log.blue "DB_PASSWORD=$DB_PASSWORD"
bashio::log.warning "Firefly-iii is using the Maria DB addon"
bashio::log.warning "Please ensure this is included in your backups"
bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
bashio::log.info "Creating database for Firefly-iii if required"
mysql \
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
-h "${DB_HOST}" -P "${DB_PORT}" \
-e "CREATE DATABASE IF NOT EXISTS \`firefly\` ;"
;;
# Use remote
*)
bashio::log.info "Using remote database. Requirement : filling all addon options fields, and making sure the database already exists"
for conditions in "DB_HOST" "DB_PORT" "DB_DATABASE" "DB_USERNAME" "DB_PASSWORD"; do
if ! bashio::config.has_value "$conditions"; then
bashio::exit.nok "Remote database has been specified but $conditions is not defined in addon options"
fi fi
done
;; # Creating symlink
rm -r /var/www/html/storage/database
ln -s /config/addons_config/fireflyiii/database /var/www/html/storage/database
# Updating permissions
chmod 775 /config/addons_config/fireflyiii/database/database.sqlite
chown -R www-data:www-data /config/addons_config/fireflyiii
chown -R www-data:www-data /var/www/html/storage
;;
# Use MariaDB
mariadb_addon)
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Detecting values..."
if ! bashio::services.available 'mysql'; then
bashio::log.fatal \
"Local database access should be provided by the MariaDB addon"
bashio::exit.nok \
"Please ensure it is installed and started"
fi
# Use values
DB_CONNECTION=mysql
DB_HOST=$(bashio::services "mysql" "host")
DB_PORT=$(bashio::services "mysql" "port")
DB_DATABASE=firefly
DB_USERNAME=$(bashio::services "mysql" "username")
DB_PASSWORD=$(bashio::services "mysql" "password")
export DB_CONNECTION
export DB_HOST && bashio::log.blue "DB_HOST=$DB_HOST"
export DB_PORT && bashio::log.blue "DB_PORT=$DB_PORT"
export DB_DATABASE && bashio::log.blue "DB_DATABASE=$DB_DATABASE"
export DB_USERNAME && bashio::log.blue "DB_USERNAME=$DB_USERNAME"
export DB_PASSWORD && bashio::log.blue "DB_PASSWORD=$DB_PASSWORD"
bashio::log.warning "Firefly-iii is using the Maria DB addon"
bashio::log.warning "Please ensure this is included in your backups"
bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
bashio::log.info "Creating database for Firefly-iii if required"
mysql \
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
-h "${DB_HOST}" -P "${DB_PORT}" \
-e "CREATE DATABASE IF NOT EXISTS \`firefly\` ;"
;;
# Use remote
*)
bashio::log.info "Using remote database. Requirement : filling all addon options fields, and making sure the database already exists"
for conditions in "DB_HOST" "DB_PORT" "DB_DATABASE" "DB_USERNAME" "DB_PASSWORD"; do
if ! bashio::config.has_value "$conditions"; then
bashio::exit.nok "Remote database has been specified but $conditions is not defined in addon options"
fi
done
;;
esac esac

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,11 +11,11 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" \
&& [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] \ && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] \
&& echo "setting permission" && chmod 755 /etc/cont-init.d/"$scripts" || (echo "script failed to install $scripts" && exit 1); done && echo "setting permission" && chmod 755 /etc/cont-init.d/"$scripts" || (echo "script failed to install $scripts" && exit 1); done
fi fi
@@ -27,9 +27,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -4,9 +4,9 @@
echo "Updating folders..." echo "Updating folders..."
for FOLDERS in "/share/grav" "/app/grav-admin/backup"; do for FOLDERS in "/share/grav" "/app/grav-admin/backup"; do
echo "... $FOLDERS" echo "... $FOLDERS"
mkdir -p $FOLDERS mkdir -p $FOLDERS
chown -R abc:abc $FOLDERS chown -R abc:abc $FOLDERS
done done
bashio::log.warning "If error of missing folder when loading addon, just restart" bashio::log.warning "If error of missing folder when loading addon, just restart"

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -1,22 +1,22 @@
#!/bin/bash #!/bin/bash
if [ ! -d /share/downloads ]; then if [ ! -d /share/downloads ]; then
echo "Creating /share/downloads" echo "Creating /share/downloads"
mkdir -p /share/downloads mkdir -p /share/downloads
chown -R abc:abc /share/downloads chown -R abc:abc /share/downloads
fi fi
if [ -d /config/Jackett ] && [ ! -d /config/addons_config/Jackett ]; then if [ -d /config/Jackett ] && [ ! -d /config/addons_config/Jackett ]; then
echo "Moving to new location /config/addons_config/Jackett" echo "Moving to new location /config/addons_config/Jackett"
mkdir -p /config/addons_config/Jackett mkdir -p /config/addons_config/Jackett
chown -R abc:abc /config/addons_config/Jackett chown -R abc:abc /config/addons_config/Jackett
mv /config/Jackett/* /config/addons_config/Jackett/ mv /config/Jackett/* /config/addons_config/Jackett/
rm -r /config/Jackett rm -r /config/Jackett
rm -r /config/jackett rm -r /config/jackett
fi fi
if [ ! -d /config/addons_config/Jackett ]; then if [ ! -d /config/addons_config/Jackett ]; then
echo "Creating /config/addons_config/Jackett" echo "Creating /config/addons_config/Jackett"
mkdir -p /config/addons_config/Jackett mkdir -p /config/addons_config/Jackett
chown -R abc:abc /config/addons_config/Jackett chown -R abc:abc /config/addons_config/Jackett
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -3,10 +3,10 @@
LOCATION=$(bashio::config 'data_location') LOCATION=$(bashio::config 'data_location')
# Check if config is located in an acceptable location # Check if config is located in an acceptable location
LOCATIONOK="" LOCATIONOK=""
for location in "/share" "/config" "/data" "/mnt"; do for location in "/share" "/config" "/data" "/mnt"; do
if [[ "$LOCATION" == "$location"* ]]; then if [[ "$LOCATION" == "$location"* ]]; then
LOCATIONOK=true LOCATIONOK=true
fi fi
done done
@@ -19,69 +19,69 @@ fi
# Set folders # Set folders
if [ ! -d /jellyfin ]; then if [ ! -d /jellyfin ]; then
echo "Creating /jellyfin" echo "Creating /jellyfin"
mkdir -p /jellyfin mkdir -p /jellyfin
chown -R abc:abc /jellyfin chown -R abc:abc /jellyfin
fi fi
if [ ! -d "$LOCATION"/tv ]; then if [ ! -d "$LOCATION"/tv ]; then
echo "Creating $LOCATION/tv" echo "Creating $LOCATION/tv"
mkdir -p "$LOCATION"/tv mkdir -p "$LOCATION"/tv
chown -R abc:abc "$LOCATION"/tv chown -R abc:abc "$LOCATION"/tv
fi fi
if [ ! -d "$LOCATION"/movies ]; then if [ ! -d "$LOCATION"/movies ]; then
echo "Creating $LOCATION/movies" echo "Creating $LOCATION/movies"
mkdir -p "$LOCATION"/movies mkdir -p "$LOCATION"/movies
chown -R abc:abc "$LOCATION"/movies chown -R abc:abc "$LOCATION"/movies
fi fi
if [ ! -d "$LOCATION" ]; then if [ ! -d "$LOCATION" ]; then
echo "Creating $LOCATION" echo "Creating $LOCATION"
mkdir -p "$LOCATION" mkdir -p "$LOCATION"
chown -R abc:abc "$LOCATION" chown -R abc:abc "$LOCATION"
fi fi
# links # links
if [ ! -d /jellyfin/cache ]; then if [ ! -d /jellyfin/cache ]; then
echo "Creating link for /jellyfin/cache" echo "Creating link for /jellyfin/cache"
mkdir -p "$LOCATION"/cache mkdir -p "$LOCATION"/cache
chown -R abc:abc "$LOCATION"/cache chown -R abc:abc "$LOCATION"/cache
ln -s "$LOCATION"/cache /jellyfin/cache ln -s "$LOCATION"/cache /jellyfin/cache
fi fi
if [ ! -d /jellyfin/data ]; then if [ ! -d /jellyfin/data ]; then
echo "Creating link for /jellyfin/data" echo "Creating link for /jellyfin/data"
mkdir -p "$LOCATION"/data mkdir -p "$LOCATION"/data
chown -R abc:abc "$LOCATION"/data chown -R abc:abc "$LOCATION"/data
ln -s "$LOCATION"/data /jellyfin/data ln -s "$LOCATION"/data /jellyfin/data
fi fi
if [ ! -d /jellyfin/logs ]; then if [ ! -d /jellyfin/logs ]; then
echo "Creating link for /jellyfin/logs" echo "Creating link for /jellyfin/logs"
mkdir -p "$LOCATION"/logs mkdir -p "$LOCATION"/logs
chown -R abc:abc "$LOCATION"/logs chown -R abc:abc "$LOCATION"/logs
ln -s "$LOCATION"/logs /jellyfin/logs ln -s "$LOCATION"/logs /jellyfin/logs
fi fi
if [ ! -d /jellyfin/metadata ]; then if [ ! -d /jellyfin/metadata ]; then
echo "Creating link for /jellyfin/metadata" echo "Creating link for /jellyfin/metadata"
mkdir -p "$LOCATION"/metadata mkdir -p "$LOCATION"/metadata
chown -R abc:abc "$LOCATION"/metadata chown -R abc:abc "$LOCATION"/metadata
ln -s "$LOCATION"/metadata /jellyfin/metadata ln -s "$LOCATION"/metadata /jellyfin/metadata
fi fi
if [ ! -d /jellyfin/plugins ]; then if [ ! -d /jellyfin/plugins ]; then
echo "Creating link for /jellyfin/plugins" echo "Creating link for /jellyfin/plugins"
mkdir -p "$LOCATION"/plugins mkdir -p "$LOCATION"/plugins
chown -R abc:abc "$LOCATION"/plugins chown -R abc:abc "$LOCATION"/plugins
ln -s "$LOCATION"/plugins /jellyfin/plugins ln -s "$LOCATION"/plugins /jellyfin/plugins
fi fi
if [ ! -d /jellyfin/root ]; then if [ ! -d /jellyfin/root ]; then
echo "Creating link for /jellyfin/root" echo "Creating link for /jellyfin/root"
mkdir -p "$LOCATION"/root mkdir -p "$LOCATION"/root
chown -R abc:abc "$LOCATION"/root chown -R abc:abc "$LOCATION"/root
ln -s "$LOCATION"/root /jellyfin/root ln -s "$LOCATION"/root /jellyfin/root
fi fi

View File

@@ -5,5 +5,5 @@ db=/config/addons_config/jellyfin/data/data/library.db
#Modify base #Modify base
if [ -f $db ]; then if [ -f $db ]; then
sqlite3 -quote ${db} "UPDATE 'TypedBaseItems' SET data = replace( data, '/config/jellyfin/', '/config/addons_config/jellyfin/' ), path = replace( path, '/config/jellyfin/', '/config/addons_config/jellyfin/' ) WHERE type='MediaBrowser.Controller.Entities.CollectionFolder';" sqlite3 -quote ${db} "UPDATE 'TypedBaseItems' SET data = replace( data, '/config/jellyfin/', '/config/addons_config/jellyfin/' ), path = replace( path, '/config/jellyfin/', '/config/addons_config/jellyfin/' ) WHERE type='MediaBrowser.Controller.Entities.CollectionFolder';"
fi fi

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -12,15 +12,15 @@ VERBOSE=$(bashio::config 'verbose') || true
# check password change # check password change
if [ "$TOKEN" = "lrMY24Byhx" ]; then if [ "$TOKEN" = "lrMY24Byhx" ]; then
bashio::log.warning "The token is still the default one, please change from addon options" bashio::log.warning "The token is still the default one, please change from addon options"
fi fi
# download latest version # download latest version
if [ "$VERBOSE" = true ]; then if [ "$VERBOSE" = true ]; then
curl -f -J -L -o /tmp/joal.tar.gz "$(curl -f -s https://api.github.com/repos/anthonyraymond/joal/releases/latest | grep -o "http.*joal.tar.gz")" curl -f -J -L -o /tmp/joal.tar.gz "$(curl -f -s https://api.github.com/repos/anthonyraymond/joal/releases/latest | grep -o "http.*joal.tar.gz")"
else else
curl -f -s -S -J -L -o /tmp/joal.tar.gz "$(curl -f -s https://api.github.com/repos/anthonyraymond/joal/releases/latest | grep -o "http.*joal.tar.gz")" >/dev/null curl -f -s -S -J -L -o /tmp/joal.tar.gz "$(curl -f -s https://api.github.com/repos/anthonyraymond/joal/releases/latest | grep -o "http.*joal.tar.gz")" >/dev/null
fi fi
mkdir -p /data/joal mkdir -p /data/joal
tar zxvf /tmp/joal.tar.gz -C /data/joal >/dev/null tar zxvf /tmp/joal.tar.gz -C /data/joal >/dev/null
@@ -34,9 +34,9 @@ bashio::log.info "Joal updated"
# If config doesn't exist, create it # If config doesn't exist, create it
if [ ! -f /config/addons_config/joal/config.json ]; then if [ ! -f /config/addons_config/joal/config.json ]; then
bashio::log.info "Symlinking config files" bashio::log.info "Symlinking config files"
mkdir -p /config/addons_config/joal mkdir -p /config/addons_config/joal
cp /data/joal/config.json /config/addons_config/joal/config.json cp /data/joal/config.json /config/addons_config/joal/config.json
fi fi
# Refresh symlink # Refresh symlink
@@ -86,9 +86,9 @@ mkdir -p /var/log/nginx && touch /var/log/nginx/error.log
############### ###############
if [ "$VERBOSE" = true ]; then if [ "$VERBOSE" = true ]; then
nohup java -jar /joal/joal.jar --joal-conf=/data/joal --spring.main.web-environment=true --server.port="8081" --joal.ui.path.prefix="${UIPATH}" --joal.ui.secret-token="$TOKEN" nohup java -jar /joal/joal.jar --joal-conf=/data/joal --spring.main.web-environment=true --server.port="8081" --joal.ui.path.prefix="${UIPATH}" --joal.ui.secret-token="$TOKEN"
else else
nohup java -jar /joal/joal.jar --joal-conf=/data/joal --spring.main.web-environment=true --server.port="8081" --joal.ui.path.prefix="${UIPATH}" --joal.ui.secret-token="$TOKEN" >/dev/null nohup java -jar /joal/joal.jar --joal-conf=/data/joal --spring.main.web-environment=true --server.port="8081" --joal.ui.path.prefix="${UIPATH}" --joal.ui.secret-token="$TOKEN" >/dev/null
fi & fi &
bashio::log.info "Please wait, loading..." bashio::log.info "Please wait, loading..."
@@ -115,11 +115,11 @@ exec nginx &
########### ###########
if bashio::config.has_value 'run_duration'; then if bashio::config.has_value 'run_duration'; then
RUNTIME=$(bashio::config 'run_duration') RUNTIME=$(bashio::config 'run_duration')
bashio::log.info "Addon will stop after $RUNTIME" bashio::log.info "Addon will stop after $RUNTIME"
sleep "$RUNTIME" && sleep "$RUNTIME" &&
bashio::log.info "Timeout achieved, addon will stop !" && bashio::log.info "Timeout achieved, addon will stop !" &&
exit 0 exit 0
else else
bashio::log.info "Run_duration option not defined, addon will run continuously" bashio::log.info "Run_duration option not defined, addon will run continuously"
fi fi

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -7,42 +7,42 @@ bashio::log.warning "Warning - minimum configuration recommended : 2 cpu cores a
# Check data location # Check data location
LOCATION=$(bashio::config 'data_location') LOCATION=$(bashio::config 'data_location')
if [[ "$LOCATION" = "null" || -z "$LOCATION" ]]; then if [[ "$LOCATION" = "null" || -z "$LOCATION" ]]; then
# Default location # Default location
LOCATION="/config/addons_config/joplin" LOCATION="/config/addons_config/joplin"
else else
bashio::log.warning "Warning : a custom data location was selected, but the previous folder will NOT be copied. You need to do it manually" bashio::log.warning "Warning : a custom data location was selected, but the previous folder will NOT be copied. You need to do it manually"
fi fi
# Create folder # Create folder
if [ ! -d "$LOCATION" ]; then if [ ! -d "$LOCATION" ]; then
echo "Creating $LOCATION" echo "Creating $LOCATION"
mkdir -p "$LOCATION" mkdir -p "$LOCATION"
fi fi
touch "$LOCATION"/database.sqlite touch "$LOCATION"/database.sqlite
if [ ! -d "$LOCATION"/resources ]; then if [ ! -d "$LOCATION"/resources ]; then
mkdir -p "$LOCATION"/resources mkdir -p "$LOCATION"/resources
fi fi
ln -s "$LOCATION"/resources /home/joplin/packages/server ln -s "$LOCATION"/resources /home/joplin/packages/server
chown -R joplin:joplin "$LOCATION" chown -R joplin:joplin "$LOCATION"
chmod -R 777 "$LOCATION" chmod -R 777 "$LOCATION"
chmod 777 "$LOCATION/database.sqlite" chmod 777 "$LOCATION/database.sqlite"
export SQLITE_DATABASE="$LOCATION/database.sqlite" export SQLITE_DATABASE="$LOCATION/database.sqlite"
if bashio::config.has_value 'POSTGRES_DATABASE'; then if bashio::config.has_value 'POSTGRES_DATABASE'; then
bashio::log.info "Using postgres" bashio::log.info "Using postgres"
bashio::config.has_value 'DB_CLIENT' && export DB_CLIENT=$(bashio::config 'DB_CLIENT') && bashio::log.info 'Database client set' bashio::config.has_value 'DB_CLIENT' && export DB_CLIENT=$(bashio::config 'DB_CLIENT') && bashio::log.info 'Database client set'
bashio::config.has_value 'POSTGRES_PASSWORD' && export POSTGRES_PASSWORD=$(bashio::config 'POSTGRES_PASSWORD') && bashio::log.info 'Postgrep Password set' bashio::config.has_value 'POSTGRES_PASSWORD' && export POSTGRES_PASSWORD=$(bashio::config 'POSTGRES_PASSWORD') && bashio::log.info 'Postgrep Password set'
bashio::config.has_value 'POSTGRES_DATABASE' && export POSTGRES_DATABASE=$(bashio::config 'POSTGRES_DATABASE') && bashio::log.info 'Postgrep Database set' bashio::config.has_value 'POSTGRES_DATABASE' && export POSTGRES_DATABASE=$(bashio::config 'POSTGRES_DATABASE') && bashio::log.info 'Postgrep Database set'
bashio::config.has_value 'POSTGRES_USER' && export POSTGRES_USER=$(bashio::config 'POSTGRES_USER') && bashio::log.info 'Postgrep User set' bashio::config.has_value 'POSTGRES_USER' && export POSTGRES_USER=$(bashio::config 'POSTGRES_USER') && bashio::log.info 'Postgrep User set'
bashio::config.has_value 'POSTGRES_PORT' && export POSTGRES_PORT=$(bashio::config 'POSTGRES_PORT') && bashio::log.info 'Postgrep Port set' bashio::config.has_value 'POSTGRES_PORT' && export POSTGRES_PORT=$(bashio::config 'POSTGRES_PORT') && bashio::log.info 'Postgrep Port set'
bashio::config.has_value 'POSTGRES_HOST' && export POSTGRES_HOST=$(bashio::config 'POSTGRES_HOST') && bashio::log.info 'Postgrep Host set' bashio::config.has_value 'POSTGRES_HOST' && export POSTGRES_HOST=$(bashio::config 'POSTGRES_HOST') && bashio::log.info 'Postgrep Host set'
else else
bashio::log.info "Using sqlite" bashio::log.info "Using sqlite"
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -2,27 +2,27 @@
# shellcheck shell=bash # shellcheck shell=bash
if [ ! -d /share/music ]; then if [ ! -d /share/music ]; then
echo "Creating /share/music" echo "Creating /share/music"
mkdir -p /share/music mkdir -p /share/music
chown -R abc:abc /share/music chown -R abc:abc /share/music
fi fi
if [ ! -d /share/downloads ]; then if [ ! -d /share/downloads ]; then
echo "Creating /share/downloads" echo "Creating /share/downloads"
mkdir -p /share/downloads mkdir -p /share/downloads
chown -R abc:abc /share/downloads chown -R abc:abc /share/downloads
fi fi
if [ -d /config/lidarr ] && [ ! -d /config/addons_config/lidarr ]; then if [ -d /config/lidarr ] && [ ! -d /config/addons_config/lidarr ]; then
echo "Moving to new location /config/addons_config/lidarr" echo "Moving to new location /config/addons_config/lidarr"
mkdir -p /config/addons_config/lidarr mkdir -p /config/addons_config/lidarr
chmod 777 /config/addons_config/lidarr chmod 777 /config/addons_config/lidarr
mv /config/lidarr/* /config/addons_config/lidarr/ mv /config/lidarr/* /config/addons_config/lidarr/
rm -r /config/lidarr rm -r /config/lidarr
fi fi
if [ ! -d /config/addons_config/lidarr ]; then if [ ! -d /config/addons_config/lidarr ]; then
echo "Creating /config/addons_config/lidarr" echo "Creating /config/addons_config/lidarr"
mkdir -p /config/addons_config/lidarr mkdir -p /config/addons_config/lidarr
chmod 777 /config/addons_config/lidarr chmod 777 /config/addons_config/lidarr
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -46,10 +46,10 @@ chmod +x "${ocpath}"/occ
printf "chmod/chown .htaccess\n" printf "chmod/chown .htaccess\n"
if [ -f "${ocpath}"/.htaccess ]; then if [ -f "${ocpath}"/.htaccess ]; then
chmod 0644 "${ocpath}"/.htaccess chmod 0644 "${ocpath}"/.htaccess
chown "${rootuser}":"${htgroup}" "${ocpath}"/.htaccess chown "${rootuser}":"${htgroup}" "${ocpath}"/.htaccess
fi fi
if [ -f "${ocpath}"/data/.htaccess ]; then if [ -f "${ocpath}"/data/.htaccess ]; then
chmod 0644 "${ocpath}"/data/.htaccess chmod 0644 "${ocpath}"/data/.htaccess
chown "${rootuser}":"${htgroup}" "${ocpath}"/data/.htaccess chown "${rootuser}":"${htgroup}" "${ocpath}"/data/.htaccess
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -22,7 +22,7 @@ Brought to you by linuxserver.io
-------------------------------------' -------------------------------------'
if [[ -f /donate.txt ]]; then if [[ -f /donate.txt ]]; then
echo ' echo '
To support the app dev(s) visit:' To support the app dev(s) visit:'
cat /donate.txt cat /donate.txt
fi fi
echo ' echo '

View File

@@ -3,22 +3,22 @@
if bashio::config.true 'use_own_certs'; then if bashio::config.true 'use_own_certs'; then
bashio::log.info "Using referenced ssl certificates..." bashio::log.info "Using referenced ssl certificates..."
CERTFILE=$(bashio::config 'certfile') CERTFILE=$(bashio::config 'certfile')
KEYFILE=$(bashio::config 'keyfile') KEYFILE=$(bashio::config 'keyfile')
#Check if files exist #Check if files exist
echo "... checking if referenced 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/"$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 [ ! -f /ssl/"$KEYFILE" ] && bashio::log.fatal "... use_own_certs is true but certificate /ssl/$KEYFILE not found" && bashio::exit.nok
else else
mkdir -p /ssl/nextcloud/keys mkdir -p /ssl/nextcloud/keys
bashio::log.info "No ssl certificates set. Auto generating ones..." bashio::log.info "No ssl certificates set. Auto generating ones..."
SUBJECT="/C=US/ST=CA/L=Carlsbad/O=Linuxserver.io/OU=LSIO Server/CN=*" 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" 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" CERTFILE="nextcloud/keys/cert.crt"
KEYFILE="nextcloud/keys/cert.key" KEYFILE="nextcloud/keys/cert.key"
fi fi
@@ -26,13 +26,13 @@ fi
echo "... adding ssl certs in files" echo "... adding ssl certs in files"
#Sets certificates #Sets certificates
for NGINXFILE in "/defaults/default" "/config/nginx/site-confs/default" "/data/config/nginx/site-confs/default"; do for NGINXFILE in "/defaults/default" "/config/nginx/site-confs/default" "/data/config/nginx/site-confs/default"; do
if [ -f $NGINXFILE ]; then if [ -f $NGINXFILE ]; then
LINE=$(sed -n "/ssl_certificate /=" $NGINXFILE) LINE=$(sed -n "/ssl_certificate /=" $NGINXFILE)
if [[ -n "$LINE" ]]; then if [[ -n "$LINE" ]]; then
sed -i "/ssl_certificate/ d" $NGINXFILE sed -i "/ssl_certificate/ d" $NGINXFILE
sed -i "$LINE i ssl_certificate_key /ssl/$KEYFILE;" $NGINXFILE sed -i "$LINE i ssl_certificate_key /ssl/$KEYFILE;" $NGINXFILE
sed -i "$LINE i ssl_certificate /ssl/$CERTFILE;" $NGINXFILE sed -i "$LINE i ssl_certificate /ssl/$CERTFILE;" $NGINXFILE
fi
fi fi
fi
done done
bashio::log.info "... done" bashio::log.info "... done"

View File

@@ -4,20 +4,20 @@
#create folders #create folders
datadirectory=$(bashio::config 'data_directory') datadirectory=$(bashio::config 'data_directory')
mkdir -p \ mkdir -p \
"$datadirectory" \ "$datadirectory" \
/data/config/nextcloud/config \ /data/config/nextcloud/config \
/data/config/nextcloud/data \ /data/config/nextcloud/data \
/data/config/www/nextcloud/config /data/config/www/nextcloud/config
#permissions #permissions
chown abc:abc \ chown abc:abc \
"$datadirectory" \ "$datadirectory" \
/data/config/nextcloud/config \ /data/config/nextcloud/config \
/data/config/nextcloud/data \ /data/config/nextcloud/data \
/data/config/www/nextcloud/config /data/config/www/nextcloud/config
chown -R abc:abc \ chown -R abc:abc \
/var/lib/nginx /var/lib/nginx
rm -r /data/config/www/nextcloud/assets &>/dev/null rm -r /data/config/www/nextcloud/assets &>/dev/null
chmod -R 777 /data/config chmod -R 777 /data/config

View File

@@ -2,19 +2,19 @@
# create folders # create folders
mkdir -p \ mkdir -p \
"${NEXTCLOUD_PATH}" \ "${NEXTCLOUD_PATH}" \
/data/config/crontabs /data/config/crontabs
# install app # install app
if [ ! -e "${NEXTCLOUD_PATH}/index.php" ]; then if [ ! -e "${NEXTCLOUD_PATH}/index.php" ]; then
tar xf /app/nextcloud.tar.bz2 -C \ tar xf /app/nextcloud.tar.bz2 -C \
"${NEXTCLOUD_PATH}" --strip-components=1 "${NEXTCLOUD_PATH}" --strip-components=1
chown abc:abc -R \ chown abc:abc -R \
"${NEXTCLOUD_PATH}" "${NEXTCLOUD_PATH}"
chmod +x "${NEXTCLOUD_PATH}/occ" chmod +x "${NEXTCLOUD_PATH}/occ"
fi fi
#?set cronjob #?set cronjob
[[ ! -f /data/config/crontabs/root ]] && \ [[ ! -f /data/config/crontabs/root ]] && \
cp /defaults/root /data/config/crontabs/root cp /defaults/root /data/config/crontabs/root
cp /data/config/crontabs/root /etc/crontabs/root cp /data/config/crontabs/root /etc/crontabs/root

View File

@@ -8,8 +8,8 @@ sed -i "s|%%datadirectory%%|$datadirectory|g" /defaults/config.php
# copy config # copy config
[[ ! -f /data/config/www/nextcloud/config/config.php ]] && [[ ! -f /data/config/www/nextcloud/config/config.php ]] &&
cp /defaults/config.php /data/config/www/nextcloud/config/config.php cp /defaults/config.php /data/config/www/nextcloud/config/config.php
# permissions # permissions
chown abc:abc \ chown abc:abc \
/data/config/www/nextcloud/config/config.php /data/config/www/nextcloud/config/config.php

View File

@@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
if [ ! -d /data/config/www/nextcloud/apps/pdfannotate ]; then if [ ! -d /data/config/www/nextcloud/apps/pdfannotate ]; then
CURRENT="$PWD" CURRENT="$PWD"
cd /data/config/www/nextcloud/apps || exit cd /data/config/www/nextcloud/apps || exit
git clone https://gitlab.com/nextcloud-other/nextcloud-annotate pdfannotate git clone https://gitlab.com/nextcloud-other/nextcloud-annotate pdfannotate
cd "$CURRENT" || exit cd "$CURRENT" || exit
apk add --no-cache ghostscript >/dev/null apk add --no-cache ghostscript >/dev/null
echo "Nextcloud annotate app added to Nextcloud app store" echo "Nextcloud annotate app added to Nextcloud app store"
fi fi

View File

@@ -22,14 +22,14 @@ if bashio::config.has_value 'trusted_domains'; then
$LAUNCHER config:system:get trusted_domains || bashio::log.info "No trusted domain set yet. The first one will be set when doing initial configuration" $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." && bashio::log.info "Trusted domains set in the configuration. Refreshing domains." &&
################################### ###################################
# Remove previous trusted domains # # Remove previous trusted domains #
################################### ###################################
bashio::log.info "... removing previously added trusted domain (except for first one created)" bashio::log.info "... removing previously added trusted domain (except for first one created)"
i=2 i=2
until [ $i -gt 5 ]; do until [ $i -gt 5 ]; do
$LAUNCHER config:system:delete trusted_domains $i && $LAUNCHER config:system:delete trusted_domains $i &&
((i = i + 1)) || exit ((i = i + 1)) || exit
done done
########################### ###########################

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -5,15 +5,15 @@ slug=nzbget
if [ ! -d /config/addons_config/$slug ]; then if [ ! -d /config/addons_config/$slug ]; then
if [ -d /config/$slug ]; then if [ -d /config/$slug ]; then
echo "Moving to new location /config/addons_config/$slug" echo "Moving to new location /config/addons_config/$slug"
mkdir -p /config/addons_config/$slug
chmod 777 /config/addons_config/$slug
mv /config/$slug/* /config/addons_config/$slug/
rm -r /config/$slug
fi
echo "Creating /config/addons_config/$slug"
mkdir -p /config/addons_config/$slug mkdir -p /config/addons_config/$slug
chmod 777 /config/addons_config/$slug chmod 777 /config/addons_config/$slug
mv /config/$slug/* /config/addons_config/$slug/
rm -r /config/$slug
fi
echo "Creating /config/addons_config/$slug"
mkdir -p /config/addons_config/$slug
chmod 777 /config/addons_config/$slug
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -5,15 +5,15 @@ slug=ombi
if [ ! -d /config/addons_config/$slug ]; then if [ ! -d /config/addons_config/$slug ]; then
if [ -d /config/$slug ]; then if [ -d /config/$slug ]; then
echo "Moving to new location /config/addons_config/$slug" echo "Moving to new location /config/addons_config/$slug"
mkdir -p /config/addons_config/$slug
chmod 777 /config/addons_config/$slug
mv /config/$slug/* /config/addons_config/$slug/
rm -r /config/$slug
fi
echo "Creating /config/addons_config/$slug"
mkdir -p /config/addons_config/$slug mkdir -p /config/addons_config/$slug
chmod 777 /config/addons_config/$slug chmod 777 /config/addons_config/$slug
mv /config/$slug/* /config/addons_config/$slug/
rm -r /config/$slug
fi
echo "Creating /config/addons_config/$slug"
mkdir -p /config/addons_config/$slug
chmod 777 /config/addons_config/$slug
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -2,7 +2,7 @@
# shellcheck shell=bash # shellcheck shell=bash
if [ ! -d /data/organizr ]; then if [ ! -d /data/organizr ]; then
echo "Creating /data/organizr" echo "Creating /data/organizr"
mkdir -p /data/organizr mkdir -p /data/organizr
chown -R abc:abc /data/organizr chown -R abc:abc /data/organizr
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -5,15 +5,15 @@ slug=paperless
if [ ! -d /config/addons_config/$slug ]; then if [ ! -d /config/addons_config/$slug ]; then
if [ -d /config/$slug ]; then if [ -d /config/$slug ]; then
echo "Moving to new location /config/addons_config/$slug" echo "Moving to new location /config/addons_config/$slug"
mkdir -p /config/addons_config/$slug
chmod 777 /config/addons_config/$slug
mv /config/$slug/* /config/addons_config/$slug/
rm -r /config/$slug
fi
echo "Creating /config/addons_config/$slug"
mkdir -p /config/addons_config/$slug mkdir -p /config/addons_config/$slug
chmod 777 /config/addons_config/$slug chmod 777 /config/addons_config/$slug
mv /config/$slug/* /config/addons_config/$slug/
rm -r /config/$slug
fi
echo "Creating /config/addons_config/$slug"
mkdir -p /config/addons_config/$slug
chmod 777 /config/addons_config/$slug
fi fi

View File

@@ -3,14 +3,14 @@
OCRLANG=$(bashio::config 'OCRLANG') OCRLANG=$(bashio::config 'OCRLANG')
if [ -n "$OCRLANG" ]; then if [ -n "$OCRLANG" ]; then
apt-get update &>/dev/null apt-get update &>/dev/null
echo "OCRLANG variable is set, processing the language packages" echo "OCRLANG variable is set, processing the language packages"
for i in ${OCRLANG//,/ }; do for i in ${OCRLANG//,/ }; do
if apt-cache show tesseract-ocr-"${i}" >/dev/null 2>&1; then if apt-cache show tesseract-ocr-"${i}" >/dev/null 2>&1; then
apt-get install -yq tesseract-ocr-"${i}" apt-get install -yq tesseract-ocr-"${i}"
bashio::log.info "OCR Language installed : $i" || bashio::log.fatal "Couldn't install OCR lang $i. Please check its format is conform" bashio::log.info "OCR Language installed : $i" || bashio::log.fatal "Couldn't install OCR lang $i. Please check its format is conform"
else else
echo "package tesseract-ocr-${i} not found in the repository, skipping" echo "package tesseract-ocr-${i} not found in the repository, skipping"
fi fi
done done
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -11,9 +11,9 @@ mkdir -p "$CONFIGLOCATION"/config
# Copy previous config if existing # Copy previous config if existing
if [ -d /data/config ]; then if [ -d /data/config ]; then
echo "Moving to new location $CONFIGLOCATION" echo "Moving to new location $CONFIGLOCATION"
mv /data/config/* "$CONFIGLOCATION"/config/ mv /data/config/* "$CONFIGLOCATION"/config/
rm -r /data/config rm -r /data/config
fi fi
# Make sure permissions are right # Make sure permissions are right

View File

@@ -26,20 +26,20 @@ bashio::log.info "Import dir set to $IMPORTDIR"
################## ##################
if [ ! -d /config ]; then if [ ! -d /config ]; then
echo "Creating /config" echo "Creating /config"
mkdir -p /config mkdir -p /config
fi fi
chown -R abc:abc /config chown -R abc:abc /config
if [ ! -d "$MEDIADIR" ]; then if [ ! -d "$MEDIADIR" ]; then
echo "Creating $MEDIADIR" echo "Creating $MEDIADIR"
mkdir -p "$MEDIADIR" mkdir -p "$MEDIADIR"
fi fi
chown -R abc:abc "$MEDIADIR" chown -R abc:abc "$MEDIADIR"
if [ ! -d "$IMPORTDIR" ]; then if [ ! -d "$IMPORTDIR" ]; then
echo "Creating $IMPORTDIR" echo "Creating $IMPORTDIR"
mkdir -p "$IMPORTDIR" mkdir -p "$IMPORTDIR"
fi fi
chown -R abc:abc "$IMPORTDIR" chown -R abc:abc "$IMPORTDIR"

View File

@@ -6,10 +6,10 @@ echo "Starting..."
############################ ############################
if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then if [ -f /etc/cont-init.d/00-aaa_dockerfile_backup.sh ]; then
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh chown "$(id -u)":"$(id -g)" /etc/cont-init.d/00-aaa_dockerfile_backup.sh
chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh chmod +x /etc/cont-init.d/00-aaa_dockerfile_backup.sh
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh /./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi fi
#################### ####################
@@ -17,11 +17,11 @@ fi
#################### ####################
for SCRIPTS in /etc/cont-init.d/*; do for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue [ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing" echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS" chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision # Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?" /."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -9,41 +9,41 @@ bashio::log.info "Defining database"
case $(bashio::config 'DB_TYPE') in case $(bashio::config 'DB_TYPE') in
# Use sqlite # Use sqlite
sqlite) sqlite)
bashio::log.info "Using a local sqlite database" bashio::log.info "Using a local sqlite database"
;; ;;
mariadb_addon) mariadb_addon)
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Discovering values..." bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Discovering values..."
if ! bashio::services.available 'mysql'; then if ! bashio::services.available 'mysql'; then
bashio::log.fatal \ bashio::log.fatal \
"Local database access should be provided by the MariaDB addon" "Local database access should be provided by the MariaDB addon"
bashio::exit.nok \ bashio::exit.nok \
"Please ensure it is installed and started" "Please ensure it is installed and started"
fi fi
# Install mysqlclient # Install mysqlclient
pip install pymysql &>/dev/null || true pip install pymysql &>/dev/null || true
# Use values # Use values
PHOTOPRISM_DATABASE_DRIVER="mysql" PHOTOPRISM_DATABASE_DRIVER="mysql"
PHOTOPRISM_DATABASE_SERVER="$(bashio::services 'mysql' 'host'):$(bashio::services 'mysql' 'port')" PHOTOPRISM_DATABASE_SERVER="$(bashio::services 'mysql' 'host'):$(bashio::services 'mysql' 'port')"
PHOTOPRISM_DATABASE_NAME="photoprism" PHOTOPRISM_DATABASE_NAME="photoprism"
PHOTOPRISM_DATABASE_USER="$(bashio::services 'mysql' 'username')" PHOTOPRISM_DATABASE_USER="$(bashio::services 'mysql' 'username')"
PHOTOPRISM_DATABASE_PASSWORD="$(bashio::services 'mysql' 'password')" PHOTOPRISM_DATABASE_PASSWORD="$(bashio::services 'mysql' 'password')"
export PHOTOPRISM_DATABASE_DRIVER && bashio::log.blue "PHOTOPRISM_DATABASE_DRIVER=$PHOTOPRISM_DATABASE_DRIVER" export PHOTOPRISM_DATABASE_DRIVER && bashio::log.blue "PHOTOPRISM_DATABASE_DRIVER=$PHOTOPRISM_DATABASE_DRIVER"
export PHOTOPRISM_DATABASE_SERVER && bashio::log.blue "PHOTOPRISM_DATABASE_SERVER=$PHOTOPRISM_DATABASE_SERVER" export PHOTOPRISM_DATABASE_SERVER && bashio::log.blue "PHOTOPRISM_DATABASE_SERVER=$PHOTOPRISM_DATABASE_SERVER"
export PHOTOPRISM_DATABASE_NAME && bashio::log.blue "PHOTOPRISM_DATABASE_NAME=$PHOTOPRISM_DATABASE_NAME" export PHOTOPRISM_DATABASE_NAME && bashio::log.blue "PHOTOPRISM_DATABASE_NAME=$PHOTOPRISM_DATABASE_NAME"
export PHOTOPRISM_DATABASE_USER && bashio::log.blue "PHOTOPRISM_DATABASE_USER=$PHOTOPRISM_DATABASE_USER" export PHOTOPRISM_DATABASE_USER && bashio::log.blue "PHOTOPRISM_DATABASE_USER=$PHOTOPRISM_DATABASE_USER"
export PHOTOPRISM_DATABASE_PASSWORD && bashio::log.blue "PHOTOPRISM_DATABASE_PASSWORD=$PHOTOPRISM_DATABASE_PASSWORD" export PHOTOPRISM_DATABASE_PASSWORD && bashio::log.blue "PHOTOPRISM_DATABASE_PASSWORD=$PHOTOPRISM_DATABASE_PASSWORD"
bashio::log.warning "Webtrees is using the Maria DB addon" bashio::log.warning "Webtrees is using the Maria DB addon"
bashio::log.warning "Please ensure this is included in your backups" bashio::log.warning "Please ensure this is included in your backups"
bashio::log.warning "Uninstalling the MariaDB addon will remove any data" bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
mysql --host="$(bashio::services 'mysql' 'host')" --port="$(bashio::services 'mysql' 'port')" --user="$PHOTOPRISM_DATABASE_USER" --password="$PHOTOPRISM_DATABASE_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS $PHOTOPRISM_DATABASE_NAME; CHARACTER SET = utf8mb4; COLLATE = utf8mb4_unicode_ci;" || true mysql --host="$(bashio::services 'mysql' 'host')" --port="$(bashio::services 'mysql' 'port')" --user="$PHOTOPRISM_DATABASE_USER" --password="$PHOTOPRISM_DATABASE_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS $PHOTOPRISM_DATABASE_NAME; CHARACTER SET = utf8mb4; COLLATE = utf8mb4_unicode_ci;" || true
;; ;;
esac esac
############## ##############
@@ -64,16 +64,16 @@ export PHOTOPRISM_BACKUP_PATH
# Test configs # Test configs
for variabletest in $PHOTOPRISM_STORAGE_PATH $PHOTOPRISM_ORIGINALS_PATH $PHOTOPRISM_IMPORT_PATH $PHOTOPRISM_BACKUP_PATH; do for variabletest in $PHOTOPRISM_STORAGE_PATH $PHOTOPRISM_ORIGINALS_PATH $PHOTOPRISM_IMPORT_PATH $PHOTOPRISM_BACKUP_PATH; do
# Check if path exists # Check if path exists
if bashio::fs.directory_exists "$variabletest"; then if bashio::fs.directory_exists "$variabletest"; then
true true
else else
bashio::log.info "Path $variabletest doesn't exist. Creating it now..." bashio::log.info "Path $variabletest doesn't exist. Creating it now..."
mkdir -p "$variabletest" || bashio::log.fatal "Can't create $variabletest path" mkdir -p "$variabletest" || bashio::log.fatal "Can't create $variabletest path"
fi fi
# Check if path writable # Check if path writable
# shellcheck disable=SC2015 # shellcheck disable=SC2015
touch "$variabletest"/aze && rm "$variabletest"/aze || bashio::log.fatal "$variabletest path is not writable" touch "$variabletest"/aze && rm "$variabletest"/aze || bashio::log.fatal "$variabletest path is not writable"
done done
# Start messages # Start messages

View File

@@ -7,13 +7,13 @@
########### ###########
for SCRIPTS in "/00-banner.sh" "/92-local_mounts.sh" "/92-smb_mounts.sh"; do for SCRIPTS in "/00-banner.sh" "/92-local_mounts.sh" "/92-smb_mounts.sh"; do
echo $SCRIPTS echo $SCRIPTS
chown "$(id -u)":"$(id -g)" "$SCRIPTS" chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x $SCRIPTS chmod a+x $SCRIPTS
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' $SCRIPTS sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' $SCRIPTS
/.$SCRIPTS && /.$SCRIPTS &&
true || true # Prevents script crash on failure true || true # Prevents script crash on failure
echo "exit $?" echo "exit $?"
done done
############## ##############
@@ -28,23 +28,23 @@ export PHOTOPRISM_IMPORT_PATH=$(bashio::config 'IMPORT_PATH')
export PHOTOPRISM_BACKUP_PATH=$(bashio::config 'BACKUP_PATH') export PHOTOPRISM_BACKUP_PATH=$(bashio::config 'BACKUP_PATH')
if bashio::config.has_value 'CUSTOM_OPTIONS'; then if bashio::config.has_value 'CUSTOM_OPTIONS'; then
CUSTOMOPTIONS=$(bashio::config 'CUSTOM_OPTIONS') CUSTOMOPTIONS=$(bashio::config 'CUSTOM_OPTIONS')
else else
CUSTOMOPTIONS="" CUSTOMOPTIONS=""
fi fi
# Test configs # Test configs
for variabletest in $PHOTOPRISM_STORAGE_PATH $PHOTOPRISM_ORIGINALS_PATH $PHOTOPRISM_IMPORT_PATH $PHOTOPRISM_BACKUP_PATH; do for variabletest in $PHOTOPRISM_STORAGE_PATH $PHOTOPRISM_ORIGINALS_PATH $PHOTOPRISM_IMPORT_PATH $PHOTOPRISM_BACKUP_PATH; do
# Check if path exists # Check if path exists
if bashio::fs.directory_exists "$variabletest"; then if bashio::fs.directory_exists "$variabletest"; then
true true
else else
bashio::log.info "Path $variabletest doesn't exist. Creating it now..." bashio::log.info "Path $variabletest doesn't exist. Creating it now..."
mkdir -p "$variabletest" || bashio::log.fatal "Can't create $variabletest path" mkdir -p "$variabletest" || bashio::log.fatal "Can't create $variabletest path"
fi fi
# Check if path writable # Check if path writable
# shellcheck disable=SC2015 # shellcheck disable=SC2015
touch "$variabletest"/aze && rm "$variabletest"/aze || bashio::log.fatal "$variabletest path is not writable" touch "$variabletest"/aze && rm "$variabletest"/aze || bashio::log.fatal "$variabletest path is not writable"
done done
# Start messages # Start messages

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -8,33 +8,33 @@
#Create folders #Create folders
if [ ! -d /share/piwigo ]; then if [ ! -d /share/piwigo ]; then
echo "Creating /share/piwigo" echo "Creating /share/piwigo"
mkdir -p /share/piwigo mkdir -p /share/piwigo
chown -R abc:abc /share/piwigo chown -R abc:abc /share/piwigo
else else
chown -R abc:abc /share/piwigo chown -R abc:abc /share/piwigo
fi fi
if [ ! -d /share/piwigo/config ]; then if [ ! -d /share/piwigo/config ]; then
echo "moving config folder" echo "moving config folder"
mv /gallery/local/config /share/piwigo mv /gallery/local/config /share/piwigo
ln -s /share/piwigo/config /gallery/local ln -s /share/piwigo/config /gallery/local
echo "links done" echo "links done"
else else
rm -r /gallery/local/config rm -r /gallery/local/config
ln -s /share/piwigo/config /gallery/local ln -s /share/piwigo/config /gallery/local
echo "Using existing config" echo "Using existing config"
fi fi
if [ ! -d /share/piwigo/keys ]; then if [ ! -d /share/piwigo/keys ]; then
echo "moving keys folder" echo "moving keys folder"
mv /config/keys /share/piwigo mv /config/keys /share/piwigo
ln -s /share/piwigo/keys /config ln -s /share/piwigo/keys /config
echo "links done" echo "links done"
else else
rm -r /config/keys rm -r /config/keys
ln -s /share/piwigo/keys /config ln -s /share/piwigo/keys /config
echo "Using existing keys folder" echo "Using existing keys folder"
fi fi
################## ##################

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -8,20 +8,20 @@
echo "Database stored in /share/plex" echo "Database stored in /share/plex"
if [ ! -d "/share/plex/Plex Media Server" ]; then if [ ! -d "/share/plex/Plex Media Server" ]; then
echo "... creating /share/plex/Plex Media Server" echo "... creating /share/plex/Plex Media Server"
mkdir -p "/share/plex/Plex Media Server" mkdir -p "/share/plex/Plex Media Server"
fi fi
if [ -d "/config/Library/Application Support/Plex Media Server" ]; then if [ -d "/config/Library/Application Support/Plex Media Server" ]; then
echo "... creating /symlink" echo "... creating /symlink"
rm -r "/config/Library/Application Support/*" rm -r "/config/Library/Application Support/*"
ln -s "/share/plex/Plex Media Server" "/config/Library/Application Support" ln -s "/share/plex/Plex Media Server" "/config/Library/Application Support"
fi fi
if [ ! -d "/config/Library/Application Support" ]; then if [ ! -d "/config/Library/Application Support" ]; then
echo "... creating /symlink" echo "... creating /symlink"
mkdir -p "/config/Library/Application Support" mkdir -p "/config/Library/Application Support"
ln -s "/share/plex/Plex Media Server" "/config/Library/Application Support" ln -s "/share/plex/Plex Media Server" "/config/Library/Application Support"
fi fi
chown -R abc:abc /share/plex chown -R abc:abc /share/plex

View File

@@ -5,20 +5,20 @@
################## ##################
if [ ! -d /share/plex ]; then if [ ! -d /share/plex ]; then
echo "Creating /share/plex" echo "Creating /share/plex"
mkdir -p /share/plex mkdir -p /share/plex
chown -R abc:abc /share/plex chown -R abc:abc /share/plex
else else
chown -R abc:abc /share/plex chown -R abc:abc /share/plex
fi fi
if [ ! -d /share/plex/Library ]; then if [ ! -d /share/plex/Library ]; then
echo "moving Library folder" echo "moving Library folder"
mv /config/Library /share/plex mv /config/Library /share/plex
ln -s /share/plex/Library /config ln -s /share/plex/Library /config
echo "links done" echo "links done"
else else
rm -r /config/Library rm -r /config/Library
ln -s /share/plex/Library /config ln -s /share/plex/Library /config
echo "Using existing config" echo "Using existing config"
fi fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -12,8 +12,8 @@ PUID=$(bashio::config 'PUID')
PGID=$(bashio::config 'PGID') PGID=$(bashio::config 'PGID')
if [ ! -d "$(dirname "${CONFIGSOURCE}")" ]; then if [ ! -d "$(dirname "${CONFIGSOURCE}")" ]; then
echo "Creating $(dirname "${CONFIGSOURCE}")" echo "Creating $(dirname "${CONFIGSOURCE}")"
mkdir -p "$(dirname "${CONFIGSOURCE}")" mkdir -p "$(dirname "${CONFIGSOURCE}")"
fi fi
chown -R "$PUID":"$PGID" "$(dirname "${CONFIGSOURCE}")" chown -R "$PUID":"$PGID" "$(dirname "${CONFIGSOURCE}")"

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
echo "Executing modules script : $MODULES" echo "Executing modules script : $MODULES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& mkdir -p /etc/cont-init.d \ && mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \ && for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d && chmod -R 755 /etc/cont-init.d
fi fi
####################### #######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
echo "Executing dependency script with custom elements : $PACKAGES" echo "Executing dependency script with custom elements : $PACKAGES"
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \ if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \ && if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \ && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
&& chmod 777 /automatic_packages.sh \ && chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \ && eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh && rm /automatic_packages.sh
fi fi

View File

@@ -18,6 +18,6 @@ if [ -e "/PORTFILE" ]; then
curl -f -L -s \ curl -f -L -s \
"https://github.com/portainer/portainer/releases/download/${BUILD_UPSTREAM}/portainer-${BUILD_UPSTREAM}-linux-${ARCH}.tar.gz" | "https://github.com/portainer/portainer/releases/download/${BUILD_UPSTREAM}/portainer-${BUILD_UPSTREAM}-linux-${ARCH}.tar.gz" |
tar zxvf - -C /opt/ tar zxvf - -C /opt/
echo "... success!" echo "... success!"
fi fi

View File

@@ -27,6 +27,6 @@ bashio::var.json \
certfile "$(bashio::config 'certfile')" \ certfile "$(bashio::config 'certfile')" \
keyfile "$(bashio::config 'keyfile')" \ keyfile "$(bashio::config 'keyfile')" \
ssl "^$(bashio::config 'ssl')" | ssl "^$(bashio::config 'ssl')" |
tempio \ tempio \
-template /etc/nginx/templates/ingress.gtpl \ -template /etc/nginx/templates/ingress.gtpl \
-out /etc/nginx/servers/ingress.conf -out /etc/nginx/servers/ingress.conf

Some files were not shown because too many files have changed in this diff Show More