30 lines
615 B
Text
30 lines
615 B
Text
|
An example usage of egmakedb from a script:
|
||
|
|
||
|
if ret=\`egmakedb user databasename\` ; then
|
||
|
|
||
|
eval "\$ret"
|
||
|
|
||
|
echo DBHOST=$
|
||
|
echo DBNAME=$
|
||
|
echo DBOWNER=$
|
||
|
echo DBUSER=$
|
||
|
echo DBPASS=$
|
||
|
|
||
|
else
|
||
|
|
||
|
echo "Database creation failed"
|
||
|
|
||
|
fi
|
||
|
|
||
|
Another example, replicating the behaviour of the old egmakedbs script:
|
||
|
|
||
|
# Make 5 db's for user dave
|
||
|
echo "username | password | database" >> /home/dave/db.info.txt
|
||
|
for i in `seq 1 5` ; do
|
||
|
db=`printf dave_%02d $i`
|
||
|
if ret=`egmakedb dave $db` ; then
|
||
|
eval "$ret"
|
||
|
echo "$DBUSER | $DBPASS | $DBNAME" >> /home/dave/db.info.txt
|
||
|
fi
|
||
|
done
|