zeus 3 years ago
parent
commit
89c830c1d9
  1. 8
      install/usr/share/swarmlab.io/sec/sec_bootstrapmysql

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

@ -51,11 +51,15 @@ case $ROLE in
chmod 644 /etc/mysql/mysql.conf.d/mysqld.cnf
mysqld --user=root
sleep 2
if ! mysql -e "use $MYSQL_DATABASE "; then
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' "
fi
mysql exampledb -e "UPDATE wp_options SET option_name = 'home', option_value = 'http://localhost:$SERVICEPORT', autoload = 'yes' WHERE option_name = 'home' "
mysql -e "use $MYSQL_DATABASE; UPDATE wp_options SET option_name = 'siteurl', option_value = 'http://localhost:$SERVICEPORT', autoload = 'yes' WHERE option_name = 'siteurl' "
mysql -e "use $MYSQL_DATABASE; 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

Loading…
Cancel
Save