summaryrefslogtreecommitdiffstats
path: root/extras/hook-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'extras/hook-scripts')
-rwxr-xr-xextras/hook-scripts/S56glusterd-geo-rep-create-post.sh3
1 files changed, 1 insertions, 2 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