diff options
Diffstat (limited to 'handlers')
-rw-r--r-- | handlers/mysql | 2 | ||||
-rw-r--r-- | handlers/rdiff.helper | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/handlers/mysql b/handlers/mysql index 4ac631b..569b0a2 100644 --- a/handlers/mysql +++ b/handlers/mysql @@ -95,7 +95,7 @@ fi defaultsfile="" if [ "$dbusername" != "" -a "$dbpassword" != "" ]; then - home=`grep '^root:' /etc/passwd | awk -F: '{print $6}'` + home=`getent passwd "root" | awk -F: '{print $6}'` [ -d $home ] || fatal "Can't find root's home directory ($home)." mycnf="$home/.my.cnf" if [ -f $mycnf ]; then diff --git a/handlers/rdiff.helper b/handlers/rdiff.helper index 2ad2a49..8be68ac 100644 --- a/handlers/rdiff.helper +++ b/handlers/rdiff.helper @@ -81,7 +81,14 @@ do_rdiff_con() { echo "Copying root's public ssh key to authorized_keys of $rdiff_user@$rdiff_host. Specify the password for user $rdiff_user@$rdiff_host." ssh-copy-id -i /root/.ssh/id_[rd]sa.pub $rdiff_user@$rdiff_host if [ $? -ne 0 ]; then - msgBox "rdiff action wizard: error" "Failed to connect to $rdiff_user@$rdiff_host. Make sure you have the username and password correct." + echo "Couldn't copy root's public ssh key to authorized_keys of $rdiff_user@$rdiff_host. This time, testing whether directory is writable." + ssh $rdiff_user@$rdiff_host 'test -w .ssh || test -w .' + case $? in + 0 ) msgBox "rdiff action wizard: error" "Directories are writable: Probably just a typo the first time." ;; + 1 ) msgBox "rdiff action wizard: error" "Connected successfully to $rdiff_user@$rdiff_host, but unable to write. Check ownership and modes of ~$rdiff_user on $rdiff_host." ;; + 255 ) msgBox "rdiff action wizard: error" "Failed to connect to $rdiff_user@$rdiff_host. Check hostname, username, and password." ;; + * ) msgBox "rdiff action wizard: error" "Unexpected error." ;; + esac return else echo "Done. hit return to continue" |