mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-31 04:44:05 +02:00
Update 20-config
This commit is contained in:
@@ -21,9 +21,8 @@ declare incomplete_dir
|
|||||||
###############
|
###############
|
||||||
#Default folders
|
#Default folders
|
||||||
echo "Updating folders"
|
echo "Updating folders"
|
||||||
mkdir -p /config/transmission
|
mkdir -p /config/transmission || true
|
||||||
chown -R abc:abc /config/transmission
|
chown -R abc:abc /config/transmission || true
|
||||||
chown -R abc:abc /data
|
|
||||||
|
|
||||||
if ! bashio::fs.file_exists '/config/transmission/settings.json'; then
|
if ! bashio::fs.file_exists '/config/transmission/settings.json'; then
|
||||||
echo "Creating default config"
|
echo "Creating default config"
|
||||||
@@ -34,13 +33,15 @@ fi
|
|||||||
# CONFIGURATION #
|
# CONFIGURATION #
|
||||||
#################
|
#################
|
||||||
# Variables
|
# Variables
|
||||||
|
echo "Creating config"
|
||||||
download_dir=$(bashio::config 'download_dir')
|
download_dir=$(bashio::config 'download_dir')
|
||||||
incomplete_dir=$(bashio::config 'incomplete_dir')
|
incomplete_dir=$(bashio::config 'incomplete_dir')
|
||||||
CONFIG=$(/config/transmission/settings.json)
|
CONFIG=$(</config/transmission/settings.json)
|
||||||
|
|
||||||
# Permissions
|
# Permissions
|
||||||
mkdir -p $download_dir || true
|
echo "Updating permissions"
|
||||||
chown abc:abc $download_dir || true
|
mkdir -p $download_dir
|
||||||
|
chown abc:abc $download_dir
|
||||||
|
|
||||||
# if incomplete dir > 2, to allow both null and '', set it as existing
|
# if incomplete dir > 2, to allow both null and '', set it as existing
|
||||||
if [ ${#incomplete_dir} -ge 2 ]; then
|
if [ ${#incomplete_dir} -ge 2 ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user