summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2023-10-23 10:14:00 +0200
committerSimon Rettberg2023-10-23 10:14:00 +0200
commit30f8c256bc1bc0c01b76e09829ee56b780b5ddb0 (patch)
tree2885fd6594d22b2173fb53bfb73ca6a83cebf521
parent[SSPS] Cannot delete firstrun.sh (diff)
downloadsetup-scripts-30f8c256bc1bc0c01b76e09829ee56b780b5ddb0.tar.gz
setup-scripts-30f8c256bc1bc0c01b76e09829ee56b780b5ddb0.tar.xz
setup-scripts-30f8c256bc1bc0c01b76e09829ee56b780b5ddb0.zip
[SSPS] Fix patching slx-admin config on firstboot
-rwxr-xr-xsatellit_installer/static_files/system/opt/openslx/firstboot.sh8
1 files 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..."