diff options
-rwxr-xr-x | extras/hook-scripts/S56glusterd-geo-rep-create-post.sh | 3 | ||||
-rw-r--r-- | geo-replication/src/peer_add_secret_pub.in | 4 | ||||
-rwxr-xr-x | geo-replication/src/set_geo_rep_pem_keys.sh | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/extras/hook-scripts/S56glusterd-geo-rep-create-post.sh b/extras/hook-scripts/S56glusterd-geo-rep-create-post.sh index c1400148bfa..835daf819c9 100755 --- a/extras/hook-scripts/S56glusterd-geo-rep-create-post.sh +++ b/extras/hook-scripts/S56glusterd-geo-rep-create-post.sh @@ -49,8 +49,7 @@ if [ -f $pub_file ]; then # For a non-root user copy the pub file to the user's home directory # For a root user copy the pub files to priv_dir->geo-rep. if [ "$slave_user" != "root" ]; then - slave_user_home_dir=`ssh $slave_user@$slave_ip 'source /etc/profile; echo $HOME'` - echo $slave_user_home_dir + slave_user_home_dir=`ssh $slave_user@$slave_ip "getent passwd $slave_user | cut -d ':' -f 6"` scp $pub_file $slave_user@$slave_ip:$slave_user_home_dir/common_secret.pem.pub_tmp ssh $slave_user@$slave_ip "mv $slave_user_home_dir/common_secret.pem.pub_tmp $slave_user_home_dir/common_secret.pem.pub" else diff --git a/geo-replication/src/peer_add_secret_pub.in b/geo-replication/src/peer_add_secret_pub.in index 04dee1b1ea1..aed93991e58 100644 --- a/geo-replication/src/peer_add_secret_pub.in +++ b/geo-replication/src/peer_add_secret_pub.in @@ -1,9 +1,9 @@ #!/bin/bash if [ "$1" == "" ]; then - home_dir=`echo $HOME` + home_dir=`getent passwd root | cut -d ':' -f 6`; else - home_dir=`getent passwd | grep $1 | cut -d ':' -f 6`; + home_dir=`getent passwd $1 | cut -d ':' -f 6`; fi if [ "$home_dir" == "" ]; then diff --git a/geo-replication/src/set_geo_rep_pem_keys.sh b/geo-replication/src/set_geo_rep_pem_keys.sh index 16c55ed0a49..7a7bcad25c2 100755 --- a/geo-replication/src/set_geo_rep_pem_keys.sh +++ b/geo-replication/src/set_geo_rep_pem_keys.sh @@ -20,7 +20,7 @@ function main() exit 1; fi - home_dir=`getent passwd | grep $user | cut -d ':' -f 6`; + home_dir=`getent passwd $user | cut -d ':' -f 6`; if [ "$home_dir" == "" ]; then echo "No user $user found" |