diff options
author | Christian Rößler | 2015-09-01 14:54:48 +0200 |
---|---|---|
committer | Christian Rößler | 2015-09-01 14:54:48 +0200 |
commit | 6e9e3b94ff3a55ba9f32d149bfc682099efc2679 (patch) | |
tree | 3f581b3e7e2ab18897758b43e26b3c47aae77f51 | |
parent | [SSPS] (dmsd)config.properties now dmsd:images (640) (diff) | |
download | setup-scripts-6e9e3b94ff3a55ba9f32d149bfc682099efc2679.tar.gz setup-scripts-6e9e3b94ff3a55ba9f32d149bfc682099efc2679.tar.xz setup-scripts-6e9e3b94ff3a55ba9f32d149bfc682099efc2679.zip |
[SSPS] Renaming db user bwLehrpool --> db user sat
7 files changed, 26 insertions, 27 deletions
diff --git a/satellit_installer/includes/00-variables.inc b/satellit_installer/includes/00-variables.inc index 4c3240b..30b691c 100644 --- a/satellit_installer/includes/00-variables.inc +++ b/satellit_installer/includes/00-variables.inc @@ -37,5 +37,5 @@ PACKAGELIST_WITH_RECOMMENDS=" ### http for static files: HTTP_BASE="http://files.bwlp.ks.uni-freiburg.de/install/" HTTP_FILES="bwLehrpoolSuite_Server.jar db_openslx_dump.sql openslx_tftp.tar.gz" -HTTP_FILES+=" taskmanager.tar.gz db_bwLehrpool_dump.sql openslx.tar.gz" +HTTP_FILES+=" taskmanager.tar.gz db_sat_dump.sql openslx.tar.gz" HTTP_FILES+=" slx-admin.tar.gz syslinux6.tar.gz syslinux4.tar.gz" diff --git a/satellit_installer/includes/10-purge_install.inc b/satellit_installer/includes/10-purge_install.inc index bc109c8..0dbdbb6 100644 --- a/satellit_installer/includes/10-purge_install.inc +++ b/satellit_installer/includes/10-purge_install.inc @@ -10,8 +10,8 @@ purge_install() { uninstall_packages "$PACKAGELIST_SCRIPT" # read_password -# echo "# Deleting mysql databases openslx and bwLehrpool..." -# for db in openslx bwLehrpool; do +# echo "# Deleting mysql databases openslx and sat..." +# for db in openslx sat; do # mysql_delete_db "$db" "$MYSQL_ROOT_PASS" # if [ "$ERR" -ne 0 ]; then # echo -n "# Retrying: " @@ -22,8 +22,8 @@ purge_install() { # fi # done # -# echo "# Deleting mysql users openslx and bwLehrpool..." -# for user in openslx bwLehrpool; do +# echo "# Deleting mysql users openslx and sat..." +# for user in openslx sat; do # mysql_delete_user "$user" "$MYSQL_ROOT_PASS" # if [ "$ERR" -ne 0 ]; then # echo -n "# Retrying: " diff --git a/satellit_installer/includes/10-query_user.inc b/satellit_installer/includes/10-query_user.inc index e91e643..3cad8ad 100644 --- a/satellit_installer/includes/10-query_user.inc +++ b/satellit_installer/includes/10-query_user.inc @@ -38,10 +38,10 @@ query_passwords() { query_single_password MYSQL_OPENSLX_PASS="$PASS1" echo "#" - echo "# Now, on to the needed mysql user 'bwLehrpool' - you guessed it; we need a password." + echo "# Now, on to the needed mysql user 'sat' - you guessed it; we need a password." echo "# This user will be the work horse for the bwLehrpool Suite database." query_single_password - MYSQL_BWLEHRPOOL_PASS="$PASS1" + MYSQL_SAT_PASS="$PASS1" echo "#" echo -n "# Everything in order? Please press 'y' to continue; any other key to re-enter passwords: " read -p "" -n1 -s ANSWER_OK @@ -51,7 +51,7 @@ query_passwords() { # echo "OPENSLX_PASS=$OPENSLX_PASS" >> "$CONFIGDIR"/config # echo "MYSQL_ROOT_PASS=$MYSQL_ROOT_PASS" >> "$CONFIGDIR"/config # echo "MYSQL_OPENSLX_PASS=$MYSQL_OPENSLX_PASS" >> "$CONFIGDIR"/config - # echo "MYSQL_BWLEHRPOOL_PASS=$MYSQL_BWLEHRPOOL_PASS" >> "$CONFIGDIR"/config + # echo "MYSQL_SAT_PASS=$MYSQL_SAT_PASS" >> "$CONFIGDIR"/config } generate_password() { @@ -64,19 +64,18 @@ generate_password() { set_passwords() { echo -n "# Setting passwords..." OPENSLX_PASS="$(generate_password)" - # BWLEHRPOOL_PASS="$(generate_password)" MYSQL_ROOT_PASS="$(generate_password)" MYSQL_OPENSLX_PASS="$(generate_password)" - MYSQL_BWLEHRPOOL_PASS="$(generate_password)" + MYSQL_SAT_PASS="$(generate_password)" # Keep in mind the passwords stored here will be valid only temporary, # as they will be changed by the dropper script. # If you need the permanently valid password, you will need to # decrypt static_files/new_passwords.encrypted. - echo "OPENSLX_PASS=$OPENSLX_PASS" > "$CONFIGDIR"/config - echo "MYSQL_ROOT_PASS=$MYSQL_ROOT_PASS" >> "$CONFIGDIR"/config - echo "MYSQL_OPENSLX_PASS=$MYSQL_OPENSLX_PASS" >> "$CONFIGDIR"/config - echo "MYSQL_BWLEHRPOOL_PASS=$MYSQL_BWLEHRPOOL_PASS" >> "$CONFIGDIR"/config + echo "OPENSLX_PASS=$OPENSLX_PASS" > "$CONFIGDIR"/config + echo "MYSQL_ROOT_PASS=$MYSQL_ROOT_PASS" >> "$CONFIGDIR"/config + echo "MYSQL_OPENSLX_PASS=$MYSQL_OPENSLX_PASS" >> "$CONFIGDIR"/config + echo "MYSQL_SAT_PASS=$MYSQL_SAT_PASS" >> "$CONFIGDIR"/config echo "ok." } diff --git a/satellit_installer/includes/50-add_mysql_dbs_users.inc b/satellit_installer/includes/50-add_mysql_dbs_users.inc index f911fba..73a15b1 100644 --- a/satellit_installer/includes/50-add_mysql_dbs_users.inc +++ b/satellit_installer/includes/50-add_mysql_dbs_users.inc @@ -1,15 +1,15 @@ add_mysql_dbs_users() { # Now comes mysql stuff; adding databases: mysql_add_db openslx - mysql_add_db bwLehrpool + mysql_add_db sat # $1=user, $2=database, $3=privileges, $4=password - mysql_add_user bwLehrpool bwLehrpool "DELETE, INSERT, SELECT, UPDATE" "$MYSQL_BWLEHRPOOL_PASS" + mysql_add_user sat sat "DELETE, INSERT, SELECT, UPDATE" "$MYSQL_SAT_PASS" mysql_add_user openslx openslx ALL "$MYSQL_OPENSLX_PASS" # $1=user, $2=database, $3=privileges - mysql_add_privs openslx bwLehrpool ALL + mysql_add_privs openslx sat ALL # $1=sql-dumpfile, $2=database - mysql_import_dump "$BASEDIR/static_files/db_bwLehrpool_dump.sql" bwLehrpool + mysql_import_dump "$BASEDIR/static_files/db_sat_dump.sql" sat mysql_import_dump "$BASEDIR/static_files/db_openslx_dump.sql" openslx } diff --git a/satellit_installer/includes/50-install_bwSuite_server.inc b/satellit_installer/includes/50-install_bwSuite_server.inc index c501d99..2889e86 100644 --- a/satellit_installer/includes/50-install_bwSuite_server.inc +++ b/satellit_installer/includes/50-install_bwSuite_server.inc @@ -2,9 +2,9 @@ config_bwSuite_server() { # $1: Path to server directory echo -n "# Writing configuration for bwSuite server..." echo "vmstore.path = /srv/openslx/nfs" > "$1/config.properties" - echo "db.uri = jdbc:mysql://localhost/bwLehrpool?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&characterSetResults=utf8&connectionCollation=utf8mb4_unicode_ci" >> "$1/config.properties" - echo "db.username = bwLehrpool" >> "$1/config.properties" - echo "db.password = %MYSQL_BWLEHRPOOL_PASS%" >> "$1/config.properties" + echo "db.uri = jdbc:mysql://localhost/sat?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&characterSetResults=utf8&connectionCollation=utf8mb4_unicode_ci" >> "$1/config.properties" + echo "db.username = sat" >> "$1/config.properties" + echo "db.password = %MYSQL_SAT_PASS%" >> "$1/config.properties" chown dmsd:images "$1/config.properties" chmod 0640 "$1/config.properties" diff --git a/satellit_installer/static_files/rclocal_script.sh b/satellit_installer/static_files/rclocal_script.sh index f8f778f..f5d1e29 100644 --- a/satellit_installer/static_files/rclocal_script.sh +++ b/satellit_installer/static_files/rclocal_script.sh @@ -51,8 +51,8 @@ mysqladmin -u root -p"${MYSQL_ROOT_PASS}" password "${MYSQL_ROOT_NEW}" || perror # Just in case... sed -i "s/^MYSQL_ROOT_PASS=.*\$/MYSQL_ROOT_PASS=${MYSQL_ROOT_NEW}/g" "/root/installer/config" -MYSQL_BWLEHRPOOL_NEW=$(generate_password) -echo "SET PASSWORD FOR 'bwLehrpool'@'localhost' = PASSWORD('$MYSQL_BWLEHRPOOL_NEW');" | mysql -u root -p"${MYSQL_ROOT_NEW}" || perror "Neusetzen des bwLehrpool-MySQL-Passworts fehlgeschlagen." +MYSQL_SAT_NEW=$(generate_password) +echo "SET PASSWORD FOR 'sat'@'localhost' = PASSWORD('$MYSQL_SAT_NEW');" | mysql -u root -p"${MYSQL_ROOT_NEW}" || perror "Neusetzen des sat-MySQL-Passworts fehlgeschlagen." 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." @@ -66,11 +66,11 @@ chmod 600 /root/mysqlpass echo -n "Konfigurationsdateien werden aktualisiert..." >> /root/init.log -# bwLehrpool mysql pass +# sat mysql pass # Patch dmsd, vmchooser-query-script -patchfiles "%MYSQL_BWLEHRPOOL_PASS%" "$MYSQL_BWLEHRPOOL_NEW" "$DMSDDIR/config.properties" "/srv/openslx/www/vmchooser/list.php" +patchfiles "%MYSQL_SAT_PASS%" "$MYSQL_SAT_NEW" "$DMSDDIR/config.properties" "/srv/openslx/www/vmchooser/list.php" # Pureftpd -patchfiles 'MYSQLPassword.*$' "MYSQLPassword $MYSQL_BWLEHRPOOL_NEW" "/etc/pure-ftpd/db/mysql.conf" +patchfiles 'MYSQLPassword.*$' "MYSQLPassword $MYSQL_SAT_NEW" "/etc/pure-ftpd/db/mysql.conf" # openslx mysql pass # Patching openslx-mysql-userpass into slx-admin config: diff --git a/satellit_installer/static_files/vmchooser_list.php b/satellit_installer/static_files/vmchooser_list.php index b74e344..b90ddb6 100644 --- a/satellit_installer/static_files/vmchooser_list.php +++ b/satellit_installer/static_files/vmchooser_list.php @@ -1,7 +1,7 @@ <?php -$db = new mysqli('localhost', 'bwLehrpool', '%MYSQL_BWLEHRPOOL_PASS%', 'bwLehrpool'); +$db = new mysqli('localhost', 'sat', '%MYSQL_SAT_PASS%', 'sat'); if ($db->connect_errno) { printf("Connect failed: %s\n", $mysqli->connect_error); exit(); |