This commit is contained in:
Alexandre
2022-01-17 13:18:05 +01:00
parent 0b0b471cbe
commit a22ce94a46
67 changed files with 263 additions and 207 deletions

View File

@@ -1,4 +1,5 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# Allow OCR setting
OCRLANG="$(bashio::config "ocrlang")"

View File

@@ -1,24 +1,25 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
##################
# 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 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"
#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 #
@@ -30,16 +31,14 @@ if [ ! -d /config ]; then
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
fi
chown -R abc:abc $IMPORTDIR