diff options
author | Simon Rettberg | 2020-02-24 12:32:36 +0100 |
---|---|---|
committer | Simon Rettberg | 2020-02-24 12:32:36 +0100 |
commit | dc10c58e6a5f3a48e38c62098d5e7abf4eafa948 (patch) | |
tree | d73b69630f1586e7e73136779761c1e1f16517a0 /satellit_upgrader | |
parent | [SSUS] Make chown on stage4 non-fatal (diff) | |
download | setup-scripts-dc10c58e6a5f3a48e38c62098d5e7abf4eafa948.tar.gz setup-scripts-dc10c58e6a5f3a48e38c62098d5e7abf4eafa948.tar.xz setup-scripts-dc10c58e6a5f3a48e38c62098d5e7abf4eafa948.zip |
[SSPS/SSUS] Copy slxadmin-init script for later use
Diffstat (limited to 'satellit_upgrader')
-rwxr-xr-x | satellit_upgrader/pack-update.sh | 1 | ||||
-rw-r--r-- | satellit_upgrader/updater.template.sh | 14 |
2 files changed, 12 insertions, 3 deletions
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 |