mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-22 08:41:50 +02:00
chmod +x scripts
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# If dockerfile failed install manually
|
||||
|
||||
##############################
|
||||
# Automatic modules download #
|
||||
##############################
|
||||
if [ -e "/MODULESFILE" ]; then
|
||||
MODULES=$(</MODULESFILE)
|
||||
MODULES="${MODULES:-00-banner.sh}"
|
||||
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 \
|
||||
&& apt-get update && apt-get install -yqq --no-install-recommends ca-certificates || apk add --no-cache ca-certificates >/dev/null || true \
|
||||
&& 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
|
||||
|
||||
#######################
|
||||
# Automatic installer #
|
||||
#######################
|
||||
if [ -e "/ENVFILE" ]; then
|
||||
PACKAGES=$(</ENVFILE)
|
||||
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
|
||||
fi
|
||||
|
||||
if [ -e "/MODULESFILE" ] && [ ! -f /entrypoint.sh ]; then
|
||||
for scripts in $MODULES; do
|
||||
echo "$scripts : executing"
|
||||
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/"$scripts"
|
||||
chmod a+x /etc/cont-init.d/"$scripts"
|
||||
/./etc/cont-init.d/"$scripts" || echo "/etc/cont-init.d/$scripts: exiting $?"
|
||||
rm /etc/cont-init.d/"$scripts"
|
||||
done | tac
|
||||
fi
|
||||
|
||||
#######################
|
||||
# Correct permissions #
|
||||
#######################
|
||||
#[ -d /etc/services.d ] && chmod -R 777 /etc/services.d
|
||||
#[ -d /etc/cont-init.d ] && chmod -R 777 /etc/cont-init.d
|
||||
@@ -1,75 +0,0 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
bashio::log.info "Updating folder structure and permission"
|
||||
|
||||
echo "Internal location : /emby"
|
||||
mkdir -p /emby
|
||||
chown -R abc:abc /emby
|
||||
|
||||
echo "Files location : /share/storage/tv"
|
||||
mkdir -p /share/storage/tv
|
||||
chown -R abc:abc /share/storage/tv
|
||||
|
||||
echo "Files location : /share/storage/movies"
|
||||
mkdir -p /share/storage/movies
|
||||
chown -R abc:abc /share/storage/movies
|
||||
|
||||
echo "Data location : /share/emby"
|
||||
mkdir -p /share/emby
|
||||
chown -R abc:abc /share/emby
|
||||
|
||||
echo "Config location : /config/addons_config/emby"
|
||||
mkdir -p /config/addons_config/emby
|
||||
chown -R abc:abc /config/addons_config/emby
|
||||
|
||||
# links
|
||||
|
||||
if [ ! -d /emby/cache ]; then
|
||||
echo "... 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
fi
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
#################
|
||||
# NGINX SETTING #
|
||||
#################
|
||||
|
||||
declare ingress_interface
|
||||
declare ingress_port
|
||||
|
||||
echo "Adapting for ingress"
|
||||
ingress_port=$(bashio::addon.ingress_port)
|
||||
ingress_interface=$(bashio::addon.ip_address)
|
||||
sed -i "s/%%port%%/${ingress_port}/g" /etc/nginx/servers/ingress.conf
|
||||
sed -i "s/%%interface%%/${ingress_interface}/g" /etc/nginx/servers/ingress.conf
|
||||
|
||||
# Allow uppercase url
|
||||
echo "Allowing case sensitive url"
|
||||
grep -rl toLowerCase /app/emby/dashboard-ui/app.js | xargs sed -i 's/toLowerCase()/toString()/g'
|
||||
grep -rl toLowerCase /app/emby/dashboard-ui/network | xargs sed -i 's/toLowerCase()/toString()/g'
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
###############
|
||||
# SILENT MODE #
|
||||
###############
|
||||
|
||||
if bashio::config.true 'silent'; then
|
||||
APPEND=' > /dev/null'
|
||||
sed -i '$s|$|'"$APPEND"'|' /etc/services.d/*/run
|
||||
bashio::log.info 'Silent mode activated, all logs from emby server are hidden. Disable this option if you need to troubleshoot the addon.'
|
||||
fi
|
||||
Reference in New Issue
Block a user