Tidy key sharing

This commit is contained in:
Bob Mottram 2015-12-11 10:26:18 +00:00
parent a8eb9c5360
commit 6cbaa7dd13
1 changed files with 6 additions and 3 deletions

View File

@ -418,10 +418,12 @@ function disperse_key_shares {
cp $share_filename $temp_key_share_fragments/
# copy the fragments directory to the remote server
/usr/bin/sshpass -p "$REMOTE_PASSWORD" scp -r -P $REMOTE_SSH_PORT $temp_key_share_fragments $REMOTE_SERVER
/usr/bin/sshpass -p "$REMOTE_PASSWORD" \
scp -r -P $REMOTE_SSH_PORT $temp_key_share_fragments $REMOTE_SERVER
if [ ! "$?" = "0" ]; then
# Send a warning email
echo "Key share to $REMOTE_SERVER failed" | mail -s "${PROJECT_NAME} social key management" $MY_EMAIL_ADDRESS
echo "Key share to $REMOTE_SERVER failed" | \
mail -s "${PROJECT_NAME} social key management" $MY_EMAIL_ADDRESS
fi
# remove the temp file/directory
@ -429,7 +431,8 @@ function disperse_key_shares {
rm -rf $temp_key_share_dir
# Send a confirmation email
echo "Key shared to $REMOTE_SERVER" | mail -s "${PROJECT_NAME} social key management" $MY_EMAIL_ADDRESS
echo "Key ${share_filename} shared to $REMOTE_SERVER" | \
mail -s "${PROJECT_NAME} social key management" $MY_EMAIL_ADDRESS
fi
fi
fi