mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-01 05:14:04 +02:00
RIP plex meta manager, welcome kometa
This commit is contained in:
32
kometa/rootfs/etc/cont-init.d/20-configuration.sh
Executable file
32
kometa/rootfs/etc/cont-init.d/20-configuration.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
# Where is the config
|
||||
CONFIGSOURCE=$(bashio::config "KOMETA_CONFIG")
|
||||
|
||||
##################
|
||||
# Create folders #
|
||||
##################
|
||||
|
||||
PUID=$(bashio::config 'PUID')
|
||||
PGID=$(bashio::config 'PGID')
|
||||
|
||||
if [ ! -d "$(dirname "${CONFIGSOURCE}")" ]; then
|
||||
echo "Creating $(dirname "${CONFIGSOURCE}")"
|
||||
mkdir -p "$(dirname "${CONFIGSOURCE}")"
|
||||
fi
|
||||
|
||||
chown -R "$PUID":"$PGID" "$(dirname "${CONFIGSOURCE}")"
|
||||
|
||||
###################
|
||||
# Set config.yaml #
|
||||
###################
|
||||
|
||||
# Check if config file is there, or create one from template
|
||||
if [ -f "$CONFIGSOURCE" ]; then
|
||||
bashio::log.info "Using config file found in $CONFIGSOURCE"
|
||||
else
|
||||
cp /templates/config.yml "$(dirname "${CONFIGSOURCE}")"
|
||||
bashio::log.warning "No config file, creating one from template. Please correct the config.yml file before restarting the addon !"
|
||||
fi
|
||||
Reference in New Issue
Block a user