From ada9c5882f1205335911b71a88a0d7e2c71004f2 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 21 Oct 2021 23:23:46 +0200 Subject: [PATCH] Update end.sh --- webtrees/rootfs/end.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/webtrees/rootfs/end.sh b/webtrees/rootfs/end.sh index c0fd7cb51..686531b4d 100644 --- a/webtrees/rootfs/end.sh +++ b/webtrees/rootfs/end.sh @@ -2,18 +2,14 @@ DB_NAME=$(echo $DB_NAME | tr -d '"') -if [ ! -f /data/config.ini.php ] && [ -f /var/www/webtrees/data/config.ini.php ]; then -mv /var/www/webtrees/data/config.ini.php /data +if [ ! -f /data/config.ini.php ]; then +mv /var/www/webtrees/data/config.ini.php /data || bashio::log.fatal "error : config not found" ln -s /data/config.ini.php /var/www/webtrees/data -else -bashio::log.fatal "error : config not found" fi -if [ ! -f "/data/$DB_NAME.sqlite" ] && [ -f "/var/www/webtrees/data/$DB_NAME.sqlite" ]; then -mv "/var/www/webtrees/data/$DB_NAME.sqlite" /data +if [ ! -h "/data/$DB_NAME.sqlite" ]; then +mv "/var/www/webtrees/data/$DB_NAME.sqlite" /data || bashio::log.fatal "error : database /var/www/webtrees/data/$DB_NAME.sqlite not found" ln -s "/data/$DB_NAME.sqlite" /var/www/webtrees/data -else -bashio::log.fatal "error : database /var/www/webtrees/data/$DB_NAME.sqlite not found" fi bashio::log.info "Starting apache, please wait then login with $WT_USER : $WT_PASS"