This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
COMMAND="echo \"*** Starting unlock procedure...\";" | |
COMMAND="$COMMAND /usr/sbin/mariadbd --verbose --user=root --skip-grant-tables 2>/tmp/mariadbd.err &" | |
COMMAND="$COMMAND echo -n \"*** Waiting for database connection\";" | |
COMMAND="$COMMAND until mariadb -e 'SELECT 1' 2>/tmp/mariadb.err 1>/tmp/mariadb.err; do echo -n '.'; done; echo;" | |
COMMAND="$COMMAND echo '*** Connected! Setting root password to: $1';" | |
COMMAND="$COMMAND mariadb -e \"FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED BY '$1'; SHUTDOWN;\" &" |