[dd-ctl] Bundle up some docker commands

This ought to be faster and is easier to read.
merge-requests/33/head
Evilham 2022-08-31 16:33:06 +02:00
parent 34761e028b
commit 08a36cce9f
No known key found for this signature in database
GPG Key ID: AE3EE30D970886BF
2 changed files with 10 additions and 6 deletions

15
dd-ctl
View File

@ -435,12 +435,15 @@ nextcloud_scan(){
setup_moodle(){
echo " --> Applying custom settings in moodle"
docker exec -ti dd-apps-moodle php7 admin/cli/cfg.php --name=guestloginbutton --set=0
docker exec -ti dd-apps-moodle php7 admin/cli/cfg.php --name=enrol_plugins_enabled --set=manual
docker exec -ti dd-apps-moodle php7 admin/cli/cfg.php --name=enablemobilewebservice --set=0
docker exec -ti dd-apps-moodle php7 admin/cli/cfg.php --name=enablebadges --set=0
docker exec -ti dd-apps-moodle php7 admin/cli/cfg.php --name=timezone --set="${MOODLE_TIMEZONE-Europe/Madrid}"
docker exec -ti dd-apps-moodle php7 admin/cli/purge_caches.php
# TODO: check why admin/cli/cfg can't be read with -u nobody
docker exec -i dd-apps-moodle sh -s <<-EOF
php7 admin/cli/cfg.php --name=guestloginbutton --set=0
php7 admin/cli/cfg.php --name=enrol_plugins_enabled --set=manual
php7 admin/cli/cfg.php --name=enablemobilewebservice --set=0
php7 admin/cli/cfg.php --name=enablebadges --set=0
php7 admin/cli/cfg.php --name=timezone --set="${MOODLE_TIMEZONE-Europe/Madrid}"
php7 admin/cli/purge_caches.php
EOF
}
setup_wordpress(){

View File

@ -240,6 +240,7 @@ sleep 30
## Ensure SAML is set up (it errors always)
./dd-ctl saml || true
# Address Moodle custom settings, plugins and registration
NEXTCLOUD_ADMIN_USER="$(grep -E '^NEXTCLOUD_ADMIN_USER=' dd.conf | cut -d = -f 2-)"
NEXTCLOUD_ADMIN_PASSWORD="$(grep -E '^NEXTCLOUD_ADMIN_PASSWORD=' dd.conf | cut -d = -f 2-)"