mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-23 22:40:33 +02:00
fixed End Of Line Sequence
This commit is contained in:
45
papermerge/rootfs/etc/cont-init.d/99-configuration.sh
Normal file
45
papermerge/rootfs/etc/cont-init.d/99-configuration.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
|
||||
##################
|
||||
# SELECT FOLDERS #
|
||||
##################
|
||||
|
||||
#Set media dir
|
||||
MEDIADIR='"'$(bashio::config 'storage_dir')'"'
|
||||
#clean data
|
||||
sed -i '/MEDIA_DIR/d' /data/config/papermerge.conf.py
|
||||
#add data
|
||||
sed -i "2 i\MEDIA_DIR = $MEDIADIR" /data/config/papermerge.conf.py
|
||||
bashio::log.info "Storage dir set to $MEDIADIR"
|
||||
|
||||
#Set import dir
|
||||
IMPORTDIR='"'$(bashio::config 'import_dir')'"'
|
||||
#clean data
|
||||
sed -i '/IMPORTER_DIR/d' /data/config/papermerge.conf.py || true
|
||||
#add data
|
||||
sed -i "2 i\IMPORTER_DIR = $MEDIADIR" /data/config/papermerge.conf.py
|
||||
bashio::log.info "Import dir set to $IMPORTDIR"
|
||||
|
||||
##################
|
||||
# CREATE FOLDERS #
|
||||
##################
|
||||
|
||||
if [ ! -d /config ]; then
|
||||
echo "Creating /config"
|
||||
mkdir -p /config
|
||||
fi
|
||||
chown -R abc:abc /config
|
||||
|
||||
|
||||
if [ ! -d $MEDIADIR ]; then
|
||||
echo "Creating $MEDIADIR"
|
||||
mkdir -p $MEDIADIR
|
||||
fi
|
||||
chown -R abc:abc $MEDIADIR
|
||||
|
||||
|
||||
if [ ! -d $IMPORTDIR ]; then
|
||||
echo "Creating $IMPORTDIR"
|
||||
mkdir -p $IMPORTDIR
|
||||
fi
|
||||
chown -R abc:abc $IMPORTDIR
|
||||
Reference in New Issue
Block a user