mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 10:21:02 +01:00
cron user
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bashio
|
#!/usr/bin/env bashio
|
||||||
# hadolint ignore=SC2155
|
# hadolint ignore=SC2155
|
||||||
|
|
||||||
########
|
########
|
||||||
# Init #
|
# Init #
|
||||||
@@ -75,9 +75,9 @@ mariadb_addon)
|
|||||||
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Detecting values..."
|
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Detecting values..."
|
||||||
if ! bashio::services.available 'mysql'; then
|
if ! bashio::services.available 'mysql'; then
|
||||||
bashio::log.fatal \
|
bashio::log.fatal \
|
||||||
"Local database access should be provided by the MariaDB addon"
|
"Local database access should be provided by the MariaDB addon"
|
||||||
bashio::exit.nok \
|
bashio::exit.nok \
|
||||||
"Please ensure it is installed and started"
|
"Please ensure it is installed and started"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use values
|
# Use values
|
||||||
@@ -85,7 +85,7 @@ mariadb_addon)
|
|||||||
DB_HOST=$(bashio::services "mysql" "host")
|
DB_HOST=$(bashio::services "mysql" "host")
|
||||||
DB_PORT=$(bashio::services "mysql" "port")
|
DB_PORT=$(bashio::services "mysql" "port")
|
||||||
DB_DATABASE=firefly
|
DB_DATABASE=firefly
|
||||||
DB_USERNAME=$(bashio::services "mysql" "username")
|
DB_USERNAME=$(bashio::services "mysql" "username")
|
||||||
DB_PASSWORD=$(bashio::services "mysql" "password")
|
DB_PASSWORD=$(bashio::services "mysql" "password")
|
||||||
export DB_CONNECTION
|
export DB_CONNECTION
|
||||||
export DB_HOST && bashio::log.blue "DB_HOST=$DB_HOST"
|
export DB_HOST && bashio::log.blue "DB_HOST=$DB_HOST"
|
||||||
@@ -100,9 +100,9 @@ mariadb_addon)
|
|||||||
|
|
||||||
bashio::log.info "Creating database for Firefly-iii if required"
|
bashio::log.info "Creating database for Firefly-iii if required"
|
||||||
mysql \
|
mysql \
|
||||||
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
|
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
|
||||||
-h "${DB_HOST}" -P "${DB_PORT}" \
|
-h "${DB_HOST}" -P "${DB_PORT}" \
|
||||||
-e "CREATE DATABASE IF NOT EXISTS \`firefly\` ;"
|
-e "CREATE DATABASE IF NOT EXISTS \`firefly\` ;"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# Use remote
|
# Use remote
|
||||||
@@ -132,6 +132,9 @@ if bashio::config.has_value 'Updates'; then
|
|||||||
cp /templates/cronupdate /etc/cron."${FREQUENCY}"/
|
cp /templates/cronupdate /etc/cron."${FREQUENCY}"/
|
||||||
chmod 777 /etc/cron."${FREQUENCY}"/cronupdate
|
chmod 777 /etc/cron."${FREQUENCY}"/cronupdate
|
||||||
|
|
||||||
|
# Sets cron to run with www-data user
|
||||||
|
sed -i 's|root|www-data|g' /etc/crontab
|
||||||
|
|
||||||
# Starts cron
|
# Starts cron
|
||||||
service cron start
|
service cron start
|
||||||
fi
|
fi
|
||||||
@@ -143,8 +146,8 @@ fi
|
|||||||
bashio::log.info "Please wait while the app is loading !"
|
bashio::log.info "Please wait while the app is loading !"
|
||||||
|
|
||||||
if bashio::config.true 'silent'; then
|
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"
|
bashio::log.warning "Silent mode activated. Only errors will be shown. Please disable in addon options if you need to debug"
|
||||||
/./usr/local/bin/entrypoint.sh >/dev/null
|
/./usr/local/bin/entrypoint.sh >/dev/null
|
||||||
else
|
else
|
||||||
/./usr/local/bin/entrypoint.sh
|
/./usr/local/bin/entrypoint.sh
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -2,11 +2,8 @@
|
|||||||
|
|
||||||
bashio::info "Running update according to defined schedule"
|
bashio::info "Running update according to defined schedule"
|
||||||
if bashio::config.true 'silent'; then
|
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"
|
bashio::log.warning "Silent mode activated. Only errors will be shown. Please disable in addon options if you need to debug"
|
||||||
/usr/local/bin/php /var/www/html/artisan firefly:cron >/dev/null
|
/usr/local/bin/php /var/www/html/artisan firefly:cron >/dev/null
|
||||||
else
|
else
|
||||||
/usr/local/bin/php /var/www/html/artisan firefly:cron
|
/usr/local/bin/php /var/www/html/artisan firefly:cron
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chown -R www-data:www-data /config/addons_config/fireflyiii
|
|
||||||
chown -R www-data:www-data /var/www/html/storage
|
|
||||||
|
|||||||
Reference in New Issue
Block a user