domain-monitor: fix: cron user (#10846)

This commit is contained in:
Tobias
2026-01-16 09:31:53 +01:00
committed by GitHub
parent ba908d3dfd
commit f0e630cbfe
2 changed files with 7 additions and 3 deletions

View File

@@ -29,8 +29,12 @@ function update_script() {
fi
setup_mariadb
if ! grep -Fq "root /usr/bin/php /opt/domain-monitor/cron/check_domains.php" /etc/crontab; then
echo "0 0 * * * root /usr/bin/php /opt/domain-monitor/cron/check_domains.php" >>/etc/crontab
if grep -Fq "root /usr/bin/php /opt/domain-monitor/cron/check_domains.php" /etc/crontab; then
sed -i 's|root /usr/bin/php /opt/domain-monitor/cron/check_domains.php|www-data /usr/bin/php /opt/domain-monitor/cron/check_domains.php|' /etc/crontab
fi
if ! grep -Fq "www-data /usr/bin/php /opt/domain-monitor/cron/check_domains.php" /etc/crontab; then
echo "0 0 * * * www-data /usr/bin/php /opt/domain-monitor/cron/check_domains.php" >> /etc/crontab
fi
if check_for_gh_release "domain-monitor" "Hosteroid/domain-monitor"; then

View File

@@ -43,7 +43,7 @@ sed -i -e "s|^APP_ENV=.*|APP_ENV=production|" \
-e "s|^DB_USERNAME=.*|DB_USERNAME=$MARIADB_DB_USER|" \
-e "s|^DB_PASSWORD=.*|DB_PASSWORD=$MARIADB_DB_PASS|" \
-e "s|^DB_DATABASE=.*|DB_DATABASE=$MARIADB_DB_NAME|" .env
echo "0 0 * * * root /usr/bin/php /opt/domain-monitor/cron/check_domains.php" >>/etc/crontab
echo "0 0 * * * www-data /usr/bin/php /opt/domain-monitor/cron/check_domains.php" >>/etc/crontab
cat <<EOF >/etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>