diff options
author | Christian Rößler | 2017-07-31 19:04:50 +0200 |
---|---|---|
committer | Christian Rößler | 2017-07-31 19:04:50 +0200 |
commit | d7b4527c491401cd5a6b0fb65fed60cd1b064a51 (patch) | |
tree | c13833f8afdc83f096b22e5750445babc67d86d4 /satellit_installer/static_files/rclocal_script.sh | |
parent | [SSUS] Confirm update; patch post_max_size; delete dummy coursebackend (diff) | |
download | setup-scripts-d7b4527c491401cd5a6b0fb65fed60cd1b064a51.tar.gz setup-scripts-d7b4527c491401cd5a6b0fb65fed60cd1b064a51.tar.xz setup-scripts-d7b4527c491401cd5a6b0fb65fed60cd1b064a51.zip |
[SSPS] For Debian 9, ipxe patch changed etc.
Diffstat (limited to 'satellit_installer/static_files/rclocal_script.sh')
-rw-r--r-- | satellit_installer/static_files/rclocal_script.sh | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/satellit_installer/static_files/rclocal_script.sh b/satellit_installer/static_files/rclocal_script.sh index bfb11a6..381b56a 100644 --- a/satellit_installer/static_files/rclocal_script.sh +++ b/satellit_installer/static_files/rclocal_script.sh @@ -4,6 +4,18 @@ MY_PID=$$ perror() { echo "$@" >> /root/init.log [ "$MY_PID" != "$$" ] && kill "$MY_PID" + + if ! grep -q "rclocal_script.sh has thrown an error" /etc/motd; then + cat <<-EOF >> /etc/motd + + WARNING! + + rclocal_script.sh has thrown an error! + Please read /root/init.log and take appropriate measures! + This server may not work correctly! + + EOF + fi exit 5 } @@ -57,8 +69,13 @@ echo "SET PASSWORD FOR 'sat'@'localhost' = PASSWORD('$MYSQL_SAT_NEW');" | mysql MYSQL_OPENSLX_NEW=$(generate_password) echo "SET PASSWORD FOR 'openslx'@'localhost' = PASSWORD('$MYSQL_OPENSLX_NEW');" | mysql -u root -p"${MYSQL_ROOT_NEW}" || perror "Neusetzen des openslx-MySQL-Passworts fehlgeschlagen." +# Debian 9 (stretch) does not seem to have a debian-sys-maint user anymore. MYSQL_SYSMAINT_NEW=$(generate_password) -echo "SET PASSWORD FOR 'debian-sys-maint'@'localhost' = PASSWORD('$MYSQL_SYSMAINT_NEW');" | mysql -u root -p"${MYSQL_ROOT_NEW}" || perror "Neusetzen des debian-sys-maint-Passworts fehlgeschlagen." +if grep -q debian-sys-maint /etc/mysql/debian.cnf; then + echo "SET PASSWORD FOR 'debian-sys-maint'@'localhost' = PASSWORD('$MYSQL_SYSMAINT_NEW');" | mysql -u root -p"${MYSQL_ROOT_NEW}" || perror "Neusetzen des debian-sys-maint-Passworts fehlgeschlagen." + # Patching debian-sys-maint password into /etc/mysql/debian.cnf: + patchfiles 'password *=.*$' "password = $MYSQL_SYSMAINT_NEW" "/etc/mysql/debian.cnf" +fi # Store mysql root pass in root's home echo "$MYSQL_ROOT_NEW" > /root/mysqlpass @@ -74,9 +91,6 @@ patchfiles "%MYSQL_SAT_PASS%" "$MYSQL_SAT_NEW" "$DMSDDIR # Patching openslx-mysql-userpass into slx-admin config: patchfiles "%MYSQL_OPENSLX_PASS%" "$MYSQL_OPENSLX_NEW" "$WWWDIR/slx-admin/config.php" -# Patching debian-sys-maint password into /etc/mysql/debian.cnf: -patchfiles 'password *=.*$' "password = $MYSQL_SYSMAINT_NEW" "/etc/mysql/debian.cnf" - echo " ok." >> /root/init.log echo "Dienste werden aktiviert..." >> /root/init.log |