mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-10 09:51:02 +01:00
Migrate to new config logic https://github.com/alexbelgium/hassio-addons/issues/1144
This commit is contained in:
6
unpackerr/rootfs/etc/cont-init.d/01-migration.sh
Normal file
6
unpackerr/rootfs/etc/cont-init.d/01-migration.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/bashio
|
||||
|
||||
if [ -f /homeassistant/unpackerr.conf ]; then
|
||||
bashio::log.warning "Migrating unpackerr.conf to /addons_configs/$HOSTNAME/unpackerr.conf"
|
||||
mv /homeassistant/unpackerr.conf /config/unpackerr.conf
|
||||
fi
|
||||
@@ -1,11 +1,14 @@
|
||||
#!/usr/bin/bashio
|
||||
|
||||
# Set user
|
||||
if bashio::config.has_value 'PUID'; then PUID="$(bashio::config 'PUID')"; fi
|
||||
if bashio::config.has_value 'PGID'; then PGID="$(bashio::config 'PGID')"; fi
|
||||
if bashio::config.has_value 'PUID'; then export PUID="$(bashio::config 'PUID')"; fi
|
||||
if bashio::config.has_value 'PGID'; then export PGID="$(bashio::config 'PGID')"; fi
|
||||
if bashio::config.has_value 'TZ'; then export TZ="$(bashio::config 'TZ')"; fi
|
||||
|
||||
# Enable watch folder
|
||||
if bashio::config.has_value "watch_path"; then
|
||||
# Info
|
||||
bashio::log.info "Watch path is $(bashio::config 'watch_path'), creating folder and setting permission"
|
||||
# Enables folders
|
||||
sed -i "/[[folder]]/c [[folder]]" /config/unpackerr.conf
|
||||
# Set downloads path
|
||||
@@ -20,6 +23,8 @@ fi
|
||||
|
||||
# Enable extraction folder
|
||||
if bashio::config.has_value "extraction_path"; then
|
||||
# Info
|
||||
bashio::log.info "Extraction path is $(bashio::config 'extraction_path'), creating folder and setting permission"
|
||||
# Enables folders
|
||||
sed -i "/[[folder]]/c [[folder]]" /config/unpackerr.conf
|
||||
# Set extraction path
|
||||
|
||||
Reference in New Issue
Block a user