2024-03-23 06:06:28 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
for i in $(seq 1 20);
|
|
|
|
do
|
2024-04-06 06:48:58 +02:00
|
|
|
if [ -S /var/lib/mysql/mysql.sock ]
|
2024-03-23 06:06:28 +01:00
|
|
|
then
|
2024-04-06 06:48:58 +02:00
|
|
|
/usr/bin/mysql < /var/lib/mysql.private/set.password
|
2024-03-23 06:06:28 +01:00
|
|
|
echo "root password set"
|
|
|
|
exit 0
|
|
|
|
fi
|
2024-04-06 06:48:58 +02:00
|
|
|
echo waiting for mariadb to start to set root password
|
2024-03-23 06:06:28 +01:00
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
echo failed to set root password
|
|
|
|
# we fail silently, mariadb will still work, only issue is for phpmyadmin
|
|
|
|
# and non socket access
|
|
|
|
exit 0
|
|
|
|
|