mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-31 12:54:04 +02:00
emby stable
This commit is contained in:
56
emby/rootfs/etc/cont-init.d/20-folders.sh
Normal file
56
emby/rootfs/etc/cont-init.d/20-folders.sh
Normal file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
data_location="${data_location:-/share/emby}"
|
||||
config_location="/config/emby"
|
||||
log() {
|
||||
bashio::log.info "$1"
|
||||
}
|
||||
|
||||
log "Updating folder structure and permission : data stored in $data_location"
|
||||
|
||||
declare -A directories=(
|
||||
["/emby"]=""
|
||||
["/share/storage/tv"]=""
|
||||
["/share/storage/movies"]=""
|
||||
["$data_location"]=""
|
||||
["$config_location"]=""
|
||||
)
|
||||
|
||||
for dir in "${!directories[@]}"; do
|
||||
log "Creating directory: $dir"
|
||||
mkdir -p "$dir"
|
||||
chown -R "$PUID:$PGID" "$dir"
|
||||
done
|
||||
|
||||
if [ -d /homeassistant/emby ]; then
|
||||
log "Migrate previous config location"
|
||||
cp -rf /homeassistant/emby/* "$config_location"/
|
||||
mv /homeassistant/emby /homeassistant/emby_migrated
|
||||
chown -R "$PUID:$PGID" "$config_location"
|
||||
fi
|
||||
|
||||
if [ -f /homeassistant/addons_autoscripts/emby-nas.sh ]; then
|
||||
cp -rf /homeassistant/addons_autoscripts/emby-nas.sh "$config_location"/
|
||||
mv /homeassistant/addons_autoscripts/emby-nas.sh /homeassistant/addons_autoscripts/emby-nas_migrated.sh
|
||||
fi
|
||||
|
||||
declare -A links=(
|
||||
["/emby/cache"]="$data_location/cache"
|
||||
["/emby/config"]="$config_location"
|
||||
["/emby/data"]="$data_location/data"
|
||||
["/emby/logs"]="$data_location/logs"
|
||||
["/emby/metadata"]="$data_location/metadata"
|
||||
["/emby/plugins"]="$data_location/plugins"
|
||||
["/emby/root"]="$data_location/root"
|
||||
)
|
||||
|
||||
for link in "${!links[@]}"; do
|
||||
if [ ! -d "$link" ]; then
|
||||
log "Creating link for $link"
|
||||
mkdir -p "${links[$link]}"
|
||||
chown -R "$PUID:$PGID" "${links[$link]}"
|
||||
ln -s "${links[$link]}" "$link"
|
||||
fi
|
||||
done
|
||||
21
emby/rootfs/etc/cont-init.d/32-nginx.sh
Normal file
21
emby/rootfs/etc/cont-init.d/32-nginx.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
#################
|
||||
# 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/system/dashboard-ui/app.js | xargs sed -i 's/toLowerCase()/toString()/g'
|
||||
grep -rl toLowerCase /app/emby/system/dashboard-ui/network | xargs sed -i 's/toLowerCase()/toString()/g'
|
||||
13
emby/rootfs/etc/cont-init.d/91-silent.sh
Normal file
13
emby/rootfs/etc/cont-init.d/91-silent.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
###############
|
||||
# SILENT MODE #
|
||||
###############
|
||||
|
||||
if bashio::config.true 'silent'; then
|
||||
APPEND=' >/dev/null'
|
||||
sed -i '$s|$|'"$APPEND"'|' /etc/s6-overlay/s6-rc.d/svc-emby/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