Beautify bash

This commit is contained in:
alexbelgium
2022-03-16 09:56:19 +00:00
committed by GitHub
parent 9ad60be58b
commit dc791623d5
146 changed files with 2017 additions and 2017 deletions

View File

@@ -12,10 +12,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -26,9 +26,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

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

View File

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

View File

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

View File

@@ -7,83 +7,83 @@
#########################
if bashio::config.has_value 'networkdisks'; then
# Define variables
MOREDISKS=$(bashio::config 'networkdisks')
CIFS_USERNAME=$(bashio::config 'cifsusername')
CIFS_PASSWORD=$(bashio::config 'cifspassword')
MOUNTED=false
SMBVERS=""
SECVERS=""
# Define variables
MOREDISKS=$(bashio::config 'networkdisks')
CIFS_USERNAME=$(bashio::config 'cifsusername')
CIFS_PASSWORD=$(bashio::config 'cifspassword')
MOUNTED=false
SMBVERS=""
SECVERS=""
# Mount CIFS Share if configured and if Protection Mode is active
echo 'Mounting smb share(s)...'
if bashio::config.has_value 'cifsdomain'; then
DOMAIN=",domain=$(bashio::config 'cifsdomain')"
else
DOMAIN=""
fi
# Mounting disks
# 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"
# Mount CIFS Share if configured and if Protection Mode is active
echo 'Mounting smb share(s)...'
if bashio::config.has_value 'cifsdomain'; then
DOMAIN=",domain=$(bashio::config 'cifsdomain')"
else
# 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
DOMAIN=""
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

View File

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

View File

@@ -149,7 +149,7 @@ for packagestoinstall in $PACKAGES; do
[ "$VERBOSE" = true ] && echo "... $packagestoinstall"
if [ "$PACKMANAGER" = "apk" ]; then
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)
fi
[ "$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
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
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /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
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi
####################
@@ -17,11 +17,11 @@ fi
####################
for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -23,156 +23,156 @@ git config --system user.password "${GITPASS}"
git config --system user.email "${GITMAIL}"
if bashio::config.has_value 'gitapi'; then
LOGINFO="... setting github API" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
GITHUB_API_TOKEN=$(bashio::config 'gitapi')
export GITHUB_API_TOKEN
LOGINFO="... setting github API" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
GITHUB_API_TOKEN=$(bashio::config 'gitapi')
export GITHUB_API_TOKEN
fi
LOGINFO="... parse addons" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
for addons in $(bashio::config "addon|keys"); do
SLUG=$(bashio::config "addon[${addons}].slug")
REPOSITORY=$(bashio::config "addon[${addons}].repository")
UPSTREAM=$(bashio::config "addon[${addons}].upstream")
BETA=$(bashio::config "addon[${addons}].beta")
FULLTAG=$(bashio::config "addon[${addons}].fulltag")
HAVINGASSET=$(bashio::config "addon[${addons}].having_asset")
SOURCE=$(bashio::config "addon[${addons}].source")
FILTER_TEXT=$(bashio::config "addon[${addons}].filter")
BASENAME=$(basename "https://github.com/$REPOSITORY")
DATE="$(date '+%d-%m-%Y')"
SLUG=$(bashio::config "addon[${addons}].slug")
REPOSITORY=$(bashio::config "addon[${addons}].repository")
UPSTREAM=$(bashio::config "addon[${addons}].upstream")
BETA=$(bashio::config "addon[${addons}].beta")
FULLTAG=$(bashio::config "addon[${addons}].fulltag")
HAVINGASSET=$(bashio::config "addon[${addons}].having_asset")
SOURCE=$(bashio::config "addon[${addons}].source")
FILTER_TEXT=$(bashio::config "addon[${addons}].filter")
BASENAME=$(basename "https://github.com/$REPOSITORY")
DATE="$(date '+%d-%m-%Y')"
#Create or update local version
if [ ! -d "/data/$BASENAME" ]; then
LOGINFO="... $SLUG : cloning ${REPOSITORY}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
cd /data/ || exit
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"
#Create or update local version
if [ ! -d "/data/$BASENAME" ]; then
LOGINFO="... $SLUG : cloning ${REPOSITORY}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
cd /data/ || exit
git clone "https://github.com/${REPOSITORY}"
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
#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"
#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
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
#Prepare tag flag
if [ "${FILTER_TEXT}" = "null" ] || [ "${FILTER_TEXT}" = "" ]; then
FILTER_TEXT=""
# 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
LOGINFO="... $SLUG : filter_text is on" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
ARGUMENTS="$ARGUMENTS --only $FILTER_TEXT"
bashio::log.green "... $SLUG is up-to-date ${CURRENT}"
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
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
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
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /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
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi
####################
@@ -17,11 +17,11 @@ fi
####################
for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -16,8 +16,8 @@ export CLOUDCMD_PREFIX
declare ADDON_PROTOCOL=http
if bashio::config.true 'ssl'; then
ADDON_PROTOCOL=https
bashio::config.require.ssl
ADDON_PROTOCOL=https
bashio::config.require.ssl
fi
# 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
CUSTOMOPTIONS=" $(bashio::config 'CUSTOM_OPTIONS')"
CUSTOMOPTIONS=" $(bashio::config 'CUSTOM_OPTIONS')"
else
CUSTOMOPTIONS=""
CUSTOMOPTIONS=""
fi
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
DROPBOX_TOKEN=""
DROPBOX_TOKEN=""
fi
bashio::log.info "Starting..."

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -15,33 +15,33 @@ mkdir -p "$(dirname "${DATABASESOURCE}")"
# Check absence of config file
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"
mv /data/config.yaml "$CONFIGSOURCE".bak
bashio::log.warning "A current config was found in /data, it is backuped to ${CONFIGSOURCE}.bak"
mv /data/config.yaml "$CONFIGSOURCE".bak
fi
# Check if config file is there, or create one from template
if [ -f "$CONFIGSOURCE" ]; then
# Create symlink if not existing yet
[ ! -L /data/config.yaml ] && ln -sf "$CONFIGSOURCE" /data
bashio::log.info "Using config file found in $CONFIGSOURCE"
# Create symlink if not existing yet
[ ! -L /data/config.yaml ] && ln -sf "$CONFIGSOURCE" /data
bashio::log.info "Using config file found in $CONFIGSOURCE"
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed "$CONFIGSOURCE" &>ERROR || EXIT_CODE=$?
if [ "$EXIT_CODE" = 0 ]; then
echo "Config file is a valid yaml"
else
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::exit.nok
fi
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed "$CONFIGSOURCE" &>ERROR || EXIT_CODE=$?
if [ "$EXIT_CODE" = 0 ]; then
echo "Config file is a valid yaml"
else
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::exit.nok
fi
else
# Create symlink for addon to create config
touch "${CONFIGSOURCE}"
ln -sf "$CONFIGSOURCE" /data
rm "$CONFIGSOURCE"
# Need to restart
bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting."
# Create symlink for addon to create config
touch "${CONFIGSOURCE}"
ln -sf "$CONFIGSOURCE" /data
rm "$CONFIGSOURCE"
# Need to restart
bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting."
fi
# Remove previous link or file
@@ -49,14 +49,14 @@ fi
# Check if database is here or create symlink
if [ -f "$DATABASESOURCE" ]; then
# Create symlink if not existing yet
ln -sf "${DATABASESOURCE}" /data && echo "creating symlink"
bashio::log.info "Using database file found in $DATABASESOURCE"
# Create symlink if not existing yet
ln -sf "${DATABASESOURCE}" /data && echo "creating symlink"
bashio::log.info "Using database file found in $DATABASESOURCE"
else
# Create symlink for addon to create database
touch "${DATABASESOURCE}"
ln -sf "$DATABASESOURCE" /data
rm "$DATABASESOURCE"
# Create symlink for addon to create database
touch "${DATABASESOURCE}"
ln -sf "$DATABASESOURCE" /data
rm "$DATABASESOURCE"
fi
##############
@@ -69,10 +69,10 @@ echo " "
# Test mode
TZ=$(bashio::config "TZ")
if [ "$TZ" = "test" ]; then
echo "secret mode found, launching script in /config/test.sh"
cd /config || exit
chmod 777 test.sh
./test.sh
echo "secret mode found, launching script in /config/test.sh"
cd /config || exit
chmod 777 test.sh
./test.sh
fi
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
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
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /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
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi
####################
@@ -17,11 +17,11 @@ fi
####################
for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -15,33 +15,33 @@ mkdir -p "$(dirname "${DATABASESOURCE}")"
# Check absence of config file
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"
mv /data/config.yaml "$CONFIGSOURCE".bak
bashio::log.warning "A current config was found in /data, it is backuped to ${CONFIGSOURCE}.bak"
mv /data/config.yaml "$CONFIGSOURCE".bak
fi
# Check if config file is there, or create one from template
if [ -f "$CONFIGSOURCE" ]; then
# Create symlink if not existing yet
[ ! -L /data/config.yaml ] && ln -sf "$CONFIGSOURCE" /data
bashio::log.info "Using config file found in $CONFIGSOURCE"
# Create symlink if not existing yet
[ ! -L /data/config.yaml ] && ln -sf "$CONFIGSOURCE" /data
bashio::log.info "Using config file found in $CONFIGSOURCE"
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed "$CONFIGSOURCE" &>ERROR || EXIT_CODE=$?
if [ "$EXIT_CODE" = 0 ]; then
echo "Config file is a valid yaml"
else
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::exit.nok
fi
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed "$CONFIGSOURCE" &>ERROR || EXIT_CODE=$?
if [ "$EXIT_CODE" = 0 ]; then
echo "Config file is a valid yaml"
else
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::exit.nok
fi
else
# Create symlink for addon to create config
touch "${CONFIGSOURCE}"
ln -sf "$CONFIGSOURCE" /data
rm "$CONFIGSOURCE"
# Need to restart
bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting."
# Create symlink for addon to create config
touch "${CONFIGSOURCE}"
ln -sf "$CONFIGSOURCE" /data
rm "$CONFIGSOURCE"
# Need to restart
bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting."
fi
# Remove previous link or file
@@ -49,14 +49,14 @@ fi
# Check if database is here or create symlink
if [ -f "$DATABASESOURCE" ]; then
# Create symlink if not existing yet
ln -sf "${DATABASESOURCE}" /data && echo "creating symlink"
bashio::log.info "Using database file found in $DATABASESOURCE"
# Create symlink if not existing yet
ln -sf "${DATABASESOURCE}" /data && echo "creating symlink"
bashio::log.info "Using database file found in $DATABASESOURCE"
else
# Create symlink for addon to create database
touch "${DATABASESOURCE}"
ln -sf "$DATABASESOURCE" /data
rm "$DATABASESOURCE"
# Create symlink for addon to create database
touch "${DATABASESOURCE}"
ln -sf "$DATABASESOURCE" /data
rm "$DATABASESOURCE"
fi
##############
@@ -69,10 +69,10 @@ echo " "
# Test mode
TZ=$(bashio::config "TZ")
if [ "$TZ" = "test" ]; then
echo "secret mode found, launching script in /config/test.sh"
cd /config || exit
chmod 777 test.sh
./test.sh
echo "secret mode found, launching script in /config/test.sh"
cd /config || exit
chmod 777 test.sh
./test.sh
fi
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
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
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /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
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi
####################
@@ -17,11 +17,11 @@ fi
####################
for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

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

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -11,8 +11,8 @@ APP_KEY="$(bashio::config 'APP_KEY')"
# If not base64
if [[ ! "$APP_KEY" == *"base64"* ]]; then
# Check APP_KEY format
if [ ! "${#APP_KEY}" = 32 ]; then bashio::exit.nok "Your APP_KEY has ${#APP_KEY} instead of 32 characters"; fi
# Check APP_KEY format
if [ ! "${#APP_KEY}" = 32 ]; then bashio::exit.nok "Your APP_KEY has ${#APP_KEY} instead of 32 characters"; fi
fi
# Backup APP_KEY file
@@ -42,82 +42,82 @@ chmod -R 775 /config/addons_config/fireflyiii
bashio::log.info "Defining database"
case $(bashio::config 'DB_CONNECTION') in
# Use sqlite
sqlite_internal)
bashio::log.info "Using built in sqlite"
# Use sqlite
sqlite_internal)
bashio::log.info "Using built in sqlite"
# Set variable
export DB_CONNECTION=sqlite
# Set variable
export DB_CONNECTION=sqlite
# Creating folders
mkdir -p /config/addons_config/fireflyiii/database
chown -R www-data:www-data /config/addons_config/fireflyiii/database
# Creating folders
mkdir -p /config/addons_config/fireflyiii/database
chown -R www-data:www-data /config/addons_config/fireflyiii/database
# Creating database
if [ ! -f /config/addons_config/fireflyiii/database/database.sqlite ]; then
# Create database
touch /config/addons_config/fireflyiii/database/database.sqlite
# Install database
echo "updating database"
php artisan migrate:refresh --seed --quiet
php artisan firefly-iii:upgrade-database --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"
# Creating database
if [ ! -f /config/addons_config/fireflyiii/database/database.sqlite ]; then
# Create database
touch /config/addons_config/fireflyiii/database/database.sqlite
# Install database
echo "updating database"
php artisan migrate:refresh --seed --quiet
php artisan firefly-iii:upgrade-database --quiet
php artisan passport:install --quiet
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

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -11,11 +11,11 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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 "setting permission" && chmod 755 /etc/cont-init.d/"$scripts" || (echo "script failed to install $scripts" && exit 1); done
&& 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 \
&& 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 "setting permission" && chmod 755 /etc/cont-init.d/"$scripts" || (echo "script failed to install $scripts" && exit 1); done
fi
@@ -27,9 +27,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -4,9 +4,9 @@
echo "Updating folders..."
for FOLDERS in "/share/grav" "/app/grav-admin/backup"; do
echo "... $FOLDERS"
mkdir -p $FOLDERS
chown -R abc:abc $FOLDERS
echo "... $FOLDERS"
mkdir -p $FOLDERS
chown -R abc:abc $FOLDERS
done
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
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
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /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
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi
####################
@@ -17,11 +17,11 @@ fi
####################
for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -5,5 +5,5 @@ db=/config/addons_config/jellyfin/data/data/library.db
#Modify base
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

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -12,15 +12,15 @@ VERBOSE=$(bashio::config 'verbose') || true
# check password change
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
# download latest version
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
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
mkdir -p /data/joal
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 [ ! -f /config/addons_config/joal/config.json ]; then
bashio::log.info "Symlinking config files"
mkdir -p /config/addons_config/joal
cp /data/joal/config.json /config/addons_config/joal/config.json
bashio::log.info "Symlinking config files"
mkdir -p /config/addons_config/joal
cp /data/joal/config.json /config/addons_config/joal/config.json
fi
# Refresh symlink
@@ -86,9 +86,9 @@ mkdir -p /var/log/nginx && touch /var/log/nginx/error.log
###############
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
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 &
bashio::log.info "Please wait, loading..."
@@ -115,11 +115,11 @@ exec nginx &
###########
if bashio::config.has_value 'run_duration'; then
RUNTIME=$(bashio::config 'run_duration')
bashio::log.info "Addon will stop after $RUNTIME"
sleep "$RUNTIME" &&
RUNTIME=$(bashio::config 'run_duration')
bashio::log.info "Addon will stop after $RUNTIME"
sleep "$RUNTIME" &&
bashio::log.info "Timeout achieved, addon will stop !" &&
exit 0
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

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -7,42 +7,42 @@ bashio::log.warning "Warning - minimum configuration recommended : 2 cpu cores a
# Check data location
LOCATION=$(bashio::config 'data_location')
if [[ "$LOCATION" = "null" || -z "$LOCATION" ]]; then
# Default location
LOCATION="/config/addons_config/joplin"
# Default location
LOCATION="/config/addons_config/joplin"
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
# Create folder
if [ ! -d "$LOCATION" ]; then
echo "Creating $LOCATION"
mkdir -p "$LOCATION"
fi
# Create folder
if [ ! -d "$LOCATION" ]; then
echo "Creating $LOCATION"
mkdir -p "$LOCATION"
fi
touch "$LOCATION"/database.sqlite
touch "$LOCATION"/database.sqlite
if [ ! -d "$LOCATION"/resources ]; then
mkdir -p "$LOCATION"/resources
fi
ln -s "$LOCATION"/resources /home/joplin/packages/server
if [ ! -d "$LOCATION"/resources ]; then
mkdir -p "$LOCATION"/resources
fi
ln -s "$LOCATION"/resources /home/joplin/packages/server
chown -R joplin:joplin "$LOCATION"
chmod -R 777 "$LOCATION"
chmod 777 "$LOCATION/database.sqlite"
export SQLITE_DATABASE="$LOCATION/database.sqlite"
chown -R joplin:joplin "$LOCATION"
chmod -R 777 "$LOCATION"
chmod 777 "$LOCATION/database.sqlite"
export SQLITE_DATABASE="$LOCATION/database.sqlite"
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 '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_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_HOST' && export POSTGRES_HOST=$(bashio::config 'POSTGRES_HOST') && bashio::log.info 'Postgrep Host 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_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_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'
else
bashio::log.info "Using sqlite"
bashio::log.info "Using sqlite"
fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

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

View File

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

View File

@@ -2,19 +2,19 @@
# create folders
mkdir -p \
"${NEXTCLOUD_PATH}" \
/data/config/crontabs
"${NEXTCLOUD_PATH}" \
/data/config/crontabs
# install app
if [ ! -e "${NEXTCLOUD_PATH}/index.php" ]; then
tar xf /app/nextcloud.tar.bz2 -C \
"${NEXTCLOUD_PATH}" --strip-components=1
chown abc:abc -R \
"${NEXTCLOUD_PATH}"
chmod +x "${NEXTCLOUD_PATH}/occ"
tar xf /app/nextcloud.tar.bz2 -C \
"${NEXTCLOUD_PATH}" --strip-components=1
chown abc:abc -R \
"${NEXTCLOUD_PATH}"
chmod +x "${NEXTCLOUD_PATH}/occ"
fi
#?set cronjob
[[ ! -f /data/config/crontabs/root ]] && \
cp /defaults/root /data/config/crontabs/root
cp /defaults/root /data/config/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
[[ ! -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
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
if [ ! -d /data/config/www/nextcloud/apps/pdfannotate ]; then
CURRENT="$PWD"
cd /data/config/www/nextcloud/apps || exit
git clone https://gitlab.com/nextcloud-other/nextcloud-annotate pdfannotate
cd "$CURRENT" || exit
apk add --no-cache ghostscript >/dev/null
echo "Nextcloud annotate app added to Nextcloud app store"
CURRENT="$PWD"
cd /data/config/www/nextcloud/apps || exit
git clone https://gitlab.com/nextcloud-other/nextcloud-annotate pdfannotate
cd "$CURRENT" || exit
apk add --no-cache ghostscript >/dev/null
echo "Nextcloud annotate app added to Nextcloud app store"
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"
bashio::log.info "Trusted domains set in the configuration. Refreshing domains." &&
###################################
# Remove previous trusted domains #
###################################
bashio::log.info "... removing previously added trusted domain (except for first one created)"
###################################
# Remove previous trusted domains #
###################################
bashio::log.info "... removing previously added trusted domain (except for first one created)"
i=2
until [ $i -gt 5 ]; do
$LAUNCHER config:system:delete trusted_domains $i &&
((i = i + 1)) || exit
((i = i + 1)) || exit
done
###########################

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -26,20 +26,20 @@ bashio::log.info "Import dir set to $IMPORTDIR"
##################
if [ ! -d /config ]; then
echo "Creating /config"
mkdir -p /config
echo "Creating /config"
mkdir -p /config
fi
chown -R abc:abc /config
if [ ! -d "$MEDIADIR" ]; then
echo "Creating $MEDIADIR"
mkdir -p "$MEDIADIR"
echo "Creating $MEDIADIR"
mkdir -p "$MEDIADIR"
fi
chown -R abc:abc "$MEDIADIR"
if [ ! -d "$IMPORTDIR" ]; then
echo "Creating $IMPORTDIR"
mkdir -p "$IMPORTDIR"
echo "Creating $IMPORTDIR"
mkdir -p "$IMPORTDIR"
fi
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
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
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /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
/./etc/cont-init.d/00-aaa_dockerfile_backup.sh
rm /etc/cont-init.d/00-aaa_dockerfile_backup.sh
fi
####################
@@ -17,11 +17,11 @@ fi
####################
for SCRIPTS in /etc/cont-init.d/*; do
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
# Change shebang if no s6 supervision
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"
/."$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -9,41 +9,41 @@ bashio::log.info "Defining database"
case $(bashio::config 'DB_TYPE') in
# Use sqlite
sqlite)
bashio::log.info "Using a local sqlite database"
;;
# Use sqlite
sqlite)
bashio::log.info "Using a local sqlite database"
;;
mariadb_addon)
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Discovering values..."
if ! bashio::services.available 'mysql'; then
bashio::log.fatal \
"Local database access should be provided by the MariaDB addon"
bashio::exit.nok \
"Please ensure it is installed and started"
fi
mariadb_addon)
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Discovering values..."
if ! bashio::services.available 'mysql'; then
bashio::log.fatal \
"Local database access should be provided by the MariaDB addon"
bashio::exit.nok \
"Please ensure it is installed and started"
fi
# Install mysqlclient
pip install pymysql &>/dev/null || true
# Install mysqlclient
pip install pymysql &>/dev/null || true
# Use values
PHOTOPRISM_DATABASE_DRIVER="mysql"
PHOTOPRISM_DATABASE_SERVER="$(bashio::services 'mysql' 'host'):$(bashio::services 'mysql' 'port')"
PHOTOPRISM_DATABASE_NAME="photoprism"
PHOTOPRISM_DATABASE_USER="$(bashio::services 'mysql' 'username')"
PHOTOPRISM_DATABASE_PASSWORD="$(bashio::services 'mysql' 'password')"
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_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_PASSWORD && bashio::log.blue "PHOTOPRISM_DATABASE_PASSWORD=$PHOTOPRISM_DATABASE_PASSWORD"
# Use values
PHOTOPRISM_DATABASE_DRIVER="mysql"
PHOTOPRISM_DATABASE_SERVER="$(bashio::services 'mysql' 'host'):$(bashio::services 'mysql' 'port')"
PHOTOPRISM_DATABASE_NAME="photoprism"
PHOTOPRISM_DATABASE_USER="$(bashio::services 'mysql' 'username')"
PHOTOPRISM_DATABASE_PASSWORD="$(bashio::services 'mysql' 'password')"
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_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_PASSWORD && bashio::log.blue "PHOTOPRISM_DATABASE_PASSWORD=$PHOTOPRISM_DATABASE_PASSWORD"
bashio::log.warning "Webtrees 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.warning "Webtrees 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"
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
##############
@@ -64,16 +64,16 @@ export PHOTOPRISM_BACKUP_PATH
# Test configs
for variabletest in $PHOTOPRISM_STORAGE_PATH $PHOTOPRISM_ORIGINALS_PATH $PHOTOPRISM_IMPORT_PATH $PHOTOPRISM_BACKUP_PATH; do
# Check if path exists
if bashio::fs.directory_exists "$variabletest"; then
true
else
bashio::log.info "Path $variabletest doesn't exist. Creating it now..."
mkdir -p "$variabletest" || bashio::log.fatal "Can't create $variabletest path"
fi
# Check if path writable
# shellcheck disable=SC2015
touch "$variabletest"/aze && rm "$variabletest"/aze || bashio::log.fatal "$variabletest path is not writable"
# Check if path exists
if bashio::fs.directory_exists "$variabletest"; then
true
else
bashio::log.info "Path $variabletest doesn't exist. Creating it now..."
mkdir -p "$variabletest" || bashio::log.fatal "Can't create $variabletest path"
fi
# Check if path writable
# shellcheck disable=SC2015
touch "$variabletest"/aze && rm "$variabletest"/aze || bashio::log.fatal "$variabletest path is not writable"
done
# Start messages

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

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

View File

@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
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 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 \
&& 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
&& 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 \
&& 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
fi
#######################
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
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 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
&& 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 \
&& chmod 777 /automatic_packages.sh \
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
&& rm /automatic_packages.sh
fi

View File

@@ -18,6 +18,6 @@ if [ -e "/PORTFILE" ]; then
curl -f -L -s \
"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!"
fi

View File

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

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