Skip to content

Commit

Permalink
Update 99-run.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbelgium authored Jan 5, 2025
1 parent 0522a18 commit 1c6f82b
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions webtrees/rootfs/etc/cont-init.d/99-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Define variables
DATA_LOCATION="$(bashio::config "DATA_LOCATION")"
DATA_LOCATION="${DATA_LOCATION%/}"
bashio::log.info "Data is stored in $DATA_LOCATION"
DATA_LOCATION_FILE="/data/oldwebtreeshome"

# Create folders
Expand Down Expand Up @@ -138,28 +139,34 @@ elif [ -f "$DATA_LOCATION"/config.ini.php ]; then
sed -i "1a trusted_headers=\"cf-connecting-ip\"" "$DATA_LOCATION"/config.ini.php
fi

#####################
# MARIADB DISCOVERY #
#####################

echo " "
if bashio::services.available 'mysql'; then
bashio::log.green "---"
bashio::log.yellow "MariaDB addon discovered on your system. If you want to use it, you need to use those values when doing the initial startup wizard, or modify manually the config.ini.php file in /config/data (mapped to /addon_configs/xxx-webtrees/data when accessing using a third party tool)"
bashio::log.blue "Host-name : $(bashio::services "mysql" "host")"
bashio::log.blue "Port : $(bashio::services "mysql" "port")"
bashio::log.blue "Database user : $(bashio::services "mysql" "username")"
bashio::log.blue "Database password : $(bashio::services "mysql" "password")"
bashio::log.blue "Database name : webtrees"
bashio::log.blue "Database prefix : wt_"
bashio::log.green "---"
fi
echo " "

############
# END INFO #
############

bashio::log.info "Data is stored in $DATA_LOCATION"

# Execute main script
source /etc/apache2/envvars
echo "python3 /docker-entrypoint.py"
cd /var2/www/webtrees || exit 1
if [ ! -f "${DATA_LOCATION}/config.ini.php" ]; then
bashio::log.info "First boot : open the UI at $BASE_URL to access the start-up wizard"
if bashio::services.available 'mysql'; then
bashio::log.green "---"
bashio::log.yellow "MariaDB addon was found! If you want to use it, you need to use those values when doing the initial startup wizard, or modify manually the config.ini.php file in /config/data (mapped to /addon_configs/xxx-webtrees/data when accessing using a third party tool)"
bashio::log.blue "Database user : $(bashio::services "mysql" "username")"
bashio::log.blue "Database password : $(bashio::services "mysql" "password")"
bashio::log.blue "Database name : webtrees"
bashio::log.blue "Host-name : $(bashio::services "mysql" "host")"
bashio::log.blue "Port : $(bashio::services "mysql" "port")"
bashio::log.green "---"
fi
python3 /docker-entrypoint.py
else
bashio::log.info "Webtrees started. You can access your webui at : $BASE_URL"
Expand Down

0 comments on commit 1c6f82b

Please sign in to comment.