summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes/10-script_dropper.inc
diff options
context:
space:
mode:
authorChristian Rößler2014-09-23 17:38:52 +0200
committerChristian Rößler2014-09-23 17:38:52 +0200
commitcadac45a746676456f847d45194188cd36dbb4da (patch)
treed4d85271ddb1503dda8c73835ac38db420d0aa51 /satellit_installer/includes/10-script_dropper.inc
parent[SSPS] config_footer added to openslx-config.php (diff)
downloadsetup-scripts-cadac45a746676456f847d45194188cd36dbb4da.tar.gz
setup-scripts-cadac45a746676456f847d45194188cd36dbb4da.tar.xz
setup-scripts-cadac45a746676456f847d45194188cd36dbb4da.zip
[SSPS] debian-sys-maint password now changed and written to debian.cnf
Diffstat (limited to 'satellit_installer/includes/10-script_dropper.inc')
-rw-r--r--satellit_installer/includes/10-script_dropper.inc16
1 files changed, 12 insertions, 4 deletions
diff --git a/satellit_installer/includes/10-script_dropper.inc b/satellit_installer/includes/10-script_dropper.inc
index b483c94..5d08083 100644
--- a/satellit_installer/includes/10-script_dropper.inc
+++ b/satellit_installer/includes/10-script_dropper.inc
@@ -25,8 +25,8 @@ drop_script() {
echo
echo "Satellite server install post-install script"
echo
- echo "This script will set safe password for root, the mysql root user"
- echo 'and two mysql user accounts (openslx and bwLehrpool).'
+ echo "This script will set safe password for root, the mysql root user,"
+ echo 'two mysql user accounts (openslx and bwLehrpool) and debian-sys-maint.'
echo
echo "We recommend you choose a secure password for root. The other"
echo "passwords will be auto generated."
@@ -55,11 +55,16 @@ drop_script() {
MYSQL_OPENSLX_NEW=\$(generate_password)
echo "SET PASSWORD FOR 'openslx'@'localhost' = PASSWORD('\$MYSQL_OPENSLX_NEW');" | mysql -u root -p\${MYSQL_ROOT_NEW}
echo "MYSQL_OPENSLX_PASS=\$MYSQL_OPENSLX_NEW" >> /root/new_passwords
- echo "and mysql openslx password."
+ echo "mysql openslx password,"
+
+ MYSQL_SYSMAINT_NEW=\$(generate_password)
+ echo "SET PASSWORD FOR 'debian-sys-maint'@'localhost' = PASSWORD('\$MYSQL_SYSMAINT_NEW'); | mysql -u root -p\${MYSQL_ROOT_NEW}
+ echo "and debian-sys-maint."
echo "... done."
echo
- echo "Now we will save the newly set passwords in an encrypted file..."
+ echo "Now we will save the newly set passwords (save debian-sys-maint)"
+ echo "in an encrypted file..."
cat /root/new_passwords | openssl rsautl -encrypt -pubin -inkey ${BASEDIR}/static_files/finish_setup_public_key.pem > \
${BASEDIR}/static_files/new_passwords.encrypted
@@ -72,6 +77,9 @@ drop_script() {
# Patching openslx-mysql-userpass into slx-admin config:
sed -i "s/%MYSQL_OPENSLX_PASS%/\$MYSQL_OPENSLX_NEW/g" "$OPENSLXSRVDIR/www/slx-admin/config.php"
+ # Patching debian-sys-maint password into /etc/mysql/debian.cnf:
+ sed -i "s/password = .*/password = \$MYSQL_SYSMAINT_NEW/g" "/etc/mysql/debian.cnf"
+
# appending a variable with satellite server build date/time to slx-admin config:
echo "define('CONFIG_FOOTER', '(c) 2019 Heinz "$(date "+%Y-%m-%d %H:%m:%S")"');" >> "$OPENSLXSRVDIR/www/slx-admin/config.php"