@BeNE:
what do you think, can we go this way:
Code:
echo "We ask some details about MySQL and the maia user"
ok=0
while [ "$ok" = "0" ]; do
read -ep "Do you want this script to create the maia user in MySQL? [y/n] " crDbMaUser
for a in Y y; do
if [ "$crDbMaUser" = "$a" ]; then crDbMaUser=y; ok=1; fi
done
for a in N n; do
if [ "$crDbMaUser" = "$a" ]; then crDbMaUser=n; ok=1; fi
done
done
# ask the MySQL root user
if [ "$crDbMaUser" = "y" ]
then
ok=0
while [ "$ok" = "0" ]; do
read -ep "Username of a mysql root user?, eg. 'root': " dbRtUser
read -ep "Password for this user?: " dbRtPass
read -ep "again... to be sure... : " dbRtPass2
if [ "$dbRtPass" = "$dbRtPass2" ]; then ok=1; fi
done
fi
# ask the MySQL maia user
ok=0
while [ "$ok" = "0" ]; do
read -ep "Username of the mysql maia user?, eg. 'maia' or 'ispcp-maia': " dbMaUser
read -ep "Password for this user?: " dbMaPass
read -ep "again... to be sure... : " dbMaPass2
if [ "$dbMaPass" = "$dbMaPass2" ]; then ok=1; fi
done
I think it's a good start, we then have all database infos in variables... (and can send them to our headquater - hehe :-)
I'm continuing on this...
/J