Try harder to fix the pdnsmysql outage

This commit is contained in:
Bernhard Rosenkränzer 2025-02-19 00:39:03 +01:00
parent 939d2d4d23
commit 4a4c130a05
2 changed files with 4 additions and 0 deletions

View File

@ -247,6 +247,8 @@ start_nextcloud() {
run_command "docker exec -u 33 nextcloud /var/www/html/occ db:add-missing-indices"
run_command "docker exec -u 33 nextcloud /var/www/html/occ app:disable activity"
# Make sure pdns is ready before adding the records
/federated/bin/fix pdnsmysql
run_command "docker exec pdns pdnsutil add-record $DOMAIN nextcloud A 86400 $EXTERNALIP"
# Remove configs

View File

@ -57,6 +57,7 @@ EOF
chmod 600 /federated/apps/roundcube/.env
# Create database and user in mysql
/federated/bin/fix pdnsmysql
docker exec pdnsmysql bash -c "mariadb -uroot -p$MYSQL_ROOTPASSWORD -e 'create database roundcube;'" &> /dev/null
docker exec pdnsmysql bash -c "mariadb -uroot -p$MYSQL_ROOTPASSWORD -e \"CREATE USER 'roundcube'@'%' IDENTIFIED BY '$ROUNDCUBE_SECRET';\"" &> /dev/null
docker exec pdnsmysql bash -c "mariadb -uroot -p$MYSQL_ROOTPASSWORD -e \"grant all privileges on roundcube.* to 'roundcube'@'%';\"" &> /dev/null
@ -68,6 +69,7 @@ start_roundcube() {
# Start service with command to make sure it's up before proceeding
start_service "roundcube" "nc -z 192.168.0.47 80 &> /dev/null" "7"
/federated/bin/fix pdnsmysql
docker exec pdns pdnsutil add-record $DOMAIN roundcube A 86400 $EXTERNALIP &> /dev/null
[ $? -ne 0 ] && fail "Couldn't add dns record for roundcube"
docker exec pdns pdnsutil add-record $DOMAIN webmail A 86400 $EXTERNALIP &> /dev/null