From 30f8c256bc1bc0c01b76e09829ee56b780b5ddb0 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 23 Oct 2023 10:14:00 +0200 Subject: [SSPS] Fix patching slx-admin config on firstboot --- satellit_installer/static_files/system/opt/openslx/firstboot.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/satellit_installer/static_files/system/opt/openslx/firstboot.sh b/satellit_installer/static_files/system/opt/openslx/firstboot.sh index 8c94648..9c3c1cf 100755 --- a/satellit_installer/static_files/system/opt/openslx/firstboot.sh +++ b/satellit_installer/static_files/system/opt/openslx/firstboot.sh @@ -30,7 +30,7 @@ bash -n "$conf" || perror "Config file $conf has errors" . "$conf" generate_password() { - tr -dc _A-Za-z0-9 < /dev/urandom | head -c 16 + tr -dc _A-Za-z0-9 < /dev/urandom 2> /dev/null | head -c 16 } patchfiles() { @@ -60,9 +60,11 @@ echo "+++ Generiere intern genutzte Passwörter (z.B. MySQL-Zugänge) neu ..." umask 0077 MYSQL_SAT_NEW=$(generate_password) +[ -z "$MYSQL_SAT_NEW" ] && perror "Error generating mysql password for dmsd" echo "SET PASSWORD FOR 'sat'@'localhost' = PASSWORD('$MYSQL_SAT_NEW');" | mysql -u root || perror "Neusetzen des sat-MySQL-Passworts fehlgeschlagen." MYSQL_OPENSLX_NEW=$(generate_password) +[ -z "$MYSQL_OPENSLX_NEW" ] && perror "Error generating mysql password for openslx" echo "SET PASSWORD FOR 'openslx'@'localhost' = PASSWORD('$MYSQL_OPENSLX_NEW');" | mysql -u root || perror "Neusetzen des openslx-MySQL-Passworts fehlgeschlagen." echo "+++ Konfigurationsdateien werden aktualisiert..." @@ -73,11 +75,11 @@ patchfiles "%MYSQL_SAT_PASS%" "$MYSQL_SAT_NEW" "$DMSDDIR/config.prop # openslx mysql pass # Patching openslx-mysql-userpass into slx-admin config: -patchfiles "%MYSQL_OPENSLX_PASS%" "$MYSQL_OPENSLX_NEW" "$WWWDIR/slx-admin/config.php" +patchfiles "%MYSQL_OPENSLX_PASS%" "$MYSQL_OPENSLX_NEW" "$SLXADMINDIR/config.php" # taskmanager password TASKMANAGER_PASS=$(generate_password) -patchfiles "%TM_OPENSLX_PASS%" "$TASKMANAGER_PASS" "$WWWDIR/slx-admin/config.php" "$TASKMANDIR/config/config" +patchfiles "%TM_OPENSLX_PASS%" "$TASKMANAGER_PASS" "$SLXADMINDIR/config.php" "$TASKMANDIR/config/config" echo "+++ Dienste werden aktiviert..." -- cgit v1.2.3-55-g7522