summaryrefslogtreecommitdiffstats
path: root/geo-replication/src/peer_gsec_create.in
blob: 05c1638bdcd5161f00ed2ccf3ac2e19f689f5ba0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

prefix=@prefix@
exec_prefix=@exec_prefix@
libexecdir=@libexecdir@

if [ ! -f "$GLUSTERD_WORKDIR"/geo-replication/secret.pem.pub ]; then
    \rm -rf "$GLUSTERD_WORKDIR"/geo-replication/secret.pem*
    ssh-keygen -N '' -f "$GLUSTERD_WORKDIR"/geo-replication/secret.pem > /dev/null
fi

if [ ! -f "$GLUSTERD_WORKDIR"/geo-replication/tar_ssh.pem.pub ]; then
    \rm -rf "$GLUSTERD_WORKDIR"/geo-replication/tar_ssh.pem*
    ssh-keygen -N '' -f "$GLUSTERD_WORKDIR"/geo-replication/tar_ssh.pem > /dev/null
fi

if [ "Xcontainer" = "X$1" ]; then
    output1=`cat "$GLUSTERD_WORKDIR"/geo-replication/secret.pem.pub`
    output2=`cat "$GLUSTERD_WORKDIR"/geo-replication/tar_ssh.pem.pub`
else
    output1=`echo command=\"${libexecdir}/glusterfs/gsyncd\" " "``cat "$GLUSTERD_WORKDIR"/geo-replication/secret.pem.pub`
    output2=`echo command=\"tar \$\{SSH_ORIGINAL_COMMAND#* \}\" " "``cat "$GLUSTERD_WORKDIR"/geo-replication/tar_ssh.pem.pub`
fi
echo -e "$output1\n$output2"