Skip to content
Snippets Groups Projects
Commit 06edbbdd authored by micah's avatar micah :speech_balloon:
Browse files

r219@um: micah | 2005-12-27 10:32:24 -0500

 Defaults file is now set correctly for vservers
 dbhost is now added to the .my.cnf
parent 603c0154
No related branches found
No related tags found
No related merge requests found
......@@ -115,19 +115,21 @@ fi
# specify the password on the command line.
defaultsfile=""
if [ "$dbusername" != "" -a "$dbpassword" != "" ]
then
if [ $usevserver ]
then
home=`$VSERVER $vsname exec getent passwd "root" | awk -F: '{print $6}'`
home="$vroot$home"
debug "Home set to: $home"
vhome=`$VSERVER $vsname exec getent passwd "root" | awk -F: '{print $6}'`
home="$vroot$vhome"
else
home=`getent passwd "root" | awk -F: '{print $6}'`
debug "Home set to: $home"
fi
[ -d $home ] || fatal "Can't find root's home directory ($home)."
mycnf="$home/.my.cnf"
if [ -f $mycnf ]
then
# rename temporarily
......@@ -135,26 +137,36 @@ then
debug "mv $mycnf $tmpcnf"
mv $mycnf $tmpcnf
fi
oldmask=`umask`
umask 077
cat > $mycnf <<EOF
# auto generated backupninja mysql conf
[mysql]
host=$dbhost
user=$dbusername
password="$dbpassword"
[mysqldump]
host=$dbhost
user=$dbusername
password="$dbpassword"
[mysqlhotcopy]
host=$dbhost
user=$dbusername
password="$dbpassword"
EOF
umask $oldmask
if [ $usevserver ]
then
defaultsfile="--defaults-file=$vhome/.my.cnf"
else
defaultsfile="--defaults-file=$mycnf"
elif [ "$userset" == "false" ]; then
fi
# if user is set, don't use $mycnf
elif [ "$userset" == "false" ]; then
defaultsfile="--defaults-file=$configfile"
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment