This commit is contained in:
Alexandre
2023-11-21 09:53:56 +01:00
parent 2e6e4693a7
commit 8e035dde96
350 changed files with 1908 additions and 1328 deletions

View File

@@ -2,15 +2,20 @@
# shellcheck shell=bash
set -e
PATHTOFILES="$(bashio::config "CONFIG_LOCATION")"
PATHTOFILES="$(dirname "${PATHTOFILES}")"
PATHTOFILES="/data/configurations"
(
bashio::log.info "Running update according to defined schedule. Files located in $PATHTOFILES will be imported"
if bashio::config.true 'silent'; then
bashio::log.warning "Silent mode activated. Only errors will be shown. Please disable in addon options if you need to debug"
su -l www-data -s /bin/bash -c "/usr/local/bin/php /var/www/html/artisan importer:auto-import >/dev/null"
for config in "$PATHTOFILES"/*.json
do
curl --get --data-urlencode "automate=true" --data-urlencode "config=$config" http://localhost:8080 2> /dev/null
done
else
su -l www-data -s /bin/bash -c "/usr/local/bin/php /var/www/html/artisan importer:auto-import $PATHTOFILES/import_files"
for config in "$PATHTOFILES"/*.json
do
curl -vvv --get --data-urlencode "automate=true" --data-urlencode "config=$config" http://localhost:8080
done
fi
) &>/proc/1/fd/1