From 08a36cce9f949f2ec0bc08dec83aacec65bdbf14 Mon Sep 17 00:00:00 2001 From: Evilham Date: Wed, 31 Aug 2022 16:33:06 +0200 Subject: [PATCH] [dd-ctl] Bundle up some docker commands This ought to be faster and is easier to read. --- dd-ctl | 15 +++++++++------ dd-install.sh | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dd-ctl b/dd-ctl index 2867a8a..c276664 100755 --- a/dd-ctl +++ b/dd-ctl @@ -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(){ diff --git a/dd-install.sh b/dd-install.sh index d5b23ba..c3fadb1 100755 --- a/dd-install.sh +++ b/dd-install.sh @@ -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-)"