From dc10c58e6a5f3a48e38c62098d5e7abf4eafa948 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 24 Feb 2020 12:32:36 +0100 Subject: [SSPS/SSUS] Copy slxadmin-init script for later use --- satellit_upgrader/pack-update.sh | 1 + satellit_upgrader/updater.template.sh | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'satellit_upgrader') diff --git a/satellit_upgrader/pack-update.sh b/satellit_upgrader/pack-update.sh index fbe23cd..3c889f5 100755 --- a/satellit_upgrader/pack-update.sh +++ b/satellit_upgrader/pack-update.sh @@ -233,6 +233,7 @@ if [ -z "$LEAN" ]; then addinstallfile "tftpd/tftpd-remap" addinstallfile "slxadmin-init/gpg-key.asc" addinstallfile "slxadmin-init/slxadmin-init.php" + addinstallfile "slxadmin-init/init.sh" # TODO: Unify more source ../satellit_installer/includes/10-sudo_config.inc diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index f71846d..1756bc6 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -506,9 +506,11 @@ if [ -n "$TGZ_SLXADMIN" ]; then rm -f -- "/srv/openslx/www/slx-admin/modules-available/baseconfig_bwidm/baseconfig/settings.json" ln -s "${PATH_SLXADMINCACHE}/baseconfig-bwidm_settings.json" /srv/openslx/www/slx-admin/modules-available/baseconfig_bwidm/baseconfig/settings.json || \ pwarning "Could not set link ${PATH_SLXADMINCACHE}/baseconfig-bwidm_settings.json to /srv/openslx/www/slx-admin/modules-available/baseconfig_bwidm/baseconfig/settings.json - do so manually if you need bwIDM login on client computers" - # run init script - if [ -s "$FILEDIR/slxadmin-init/slxadmin-init.php" ]; then - php "$FILEDIR/slxadmin-init/slxadmin-init.php" || perror "Error running slx-admin init script" + # update init script + if [ -d "${FILEDIR}/slxadmin-init" ]; then + rm -rf -- /opt/openslx/restore.d/slxadmin-init + mkdir -p /opt/openslx/restore.d || perror "Could not create /opt/openslx/restore.d" + cp -a "${FILEDIR}/slxadmin-init" /opt/openslx/restore.d/ fi echo "Web interface upgrade complete" fi @@ -851,6 +853,12 @@ for service in "${!restart[@]}"; do restart_service "$service" done +# Run all post-restore scripts +for i in /opt/openslx/restore.d/*/init.sh; do + [ -x "$i" ] || continue + "$i" || pwarning "ERROR running post-restore script $i: $?" +done + # Patch the update version in /etc/motd sed -r -i 's/(bwLehrpool\sSatelliten-Server,\sVersion\s[WS]Sem20[12][0-9]\s[1-9]\.[0-9])(\s\[Update\s[0-9]\.[0-9][a-z]?\])?/\1 \[Update '"${SLXADMIN_FOOTER//v/}"'\]/g' /etc/motd -- cgit v1.2.3-55-g7522