zeus 3 years ago
parent
commit
343c0a4aa8
  1. 11
      install/usr/share/swarmlab.io/sec/sec_bootstrapmysql

11
install/usr/share/swarmlab.io/sec/sec_bootstrapmysql

@ -48,9 +48,15 @@ case $ROLE in
ttyd -p 3787 bash &
chmod 644 /etc/mysql/mysql.conf.d/mysqld.cnf
mysqld --user=root
tail -f /dev/null
sleep 2
mysql -e "create database $MYSQL_DATABASE ; GRANT ALL PRIVILEGES ON $MYSQL_DATABASE.* TO $MYSQL_USER@localhost IDENTIFIED BY '$MYSQL_PASSWORD'"
sleep 1
mysql exampledb -e "UPDATE wp_options SET option_name = 'siteurl', option_value = 'http://localhost:$SERVICEPORT', autoload = 'yes' WHERE option_name = 'siteurl' "
mysql exampledb -e "UPDATE wp_options SET option_name = 'home', option_value = 'http://localhost:$SERVICEPORT', autoload = 'yes' WHERE option_name = 'home' "
tail -f /dev/null
# Start ssh server
#/usr/sbin/sshd -D
;;
@ -72,8 +78,9 @@ case $ROLE in
ttyd -p 3787 bash &
chmod 644 /etc/mysql/mysql.conf.d/mysqld.cnf
mysqld --user=root
mysql -e "create database $MYSQL_DATABASE ; GRANT ALL PRIVILEGES ON $MYSQL_DATABASE.* TO $MYSQL_USER@localhost IDENTIFIED BY '$MYSQL_PASSWORD'"
sleep 2
mysql -e "create database $MYSQL_DATABASE ; GRANT ALL PRIVILEGES ON $MYSQL_DATABASE.* TO $MYSQL_USER@localhost IDENTIFIED BY '$MYSQL_PASSWORD'"
sleep 1
mysql exampledb -e "UPDATE wp_options SET option_name = 'siteurl', option_value = 'http://localhost:$SERVICEPORT', autoload = 'yes' WHERE option_name = 'siteurl' "
mysql exampledb -e "UPDATE wp_options SET option_name = 'home', option_value = 'http://localhost:$SERVICEPORT', autoload = 'yes' WHERE option_name = 'home' "

Loading…
Cancel
Save