Commit 74034f58 authored by Dillenn Terumalai's avatar Dillenn Terumalai
Browse files

Fixed recipient and added --always-trust param

parent 3aaf35f8
......@@ -15,7 +15,7 @@ COL_GREEN=${ESC_SEQ}"0;32m"
COL_MAGENTA=${ESC_SEQ}"0;35m"
# Define the UID of the recipient for GPG encryption
RECIPIENT="dillenn.terumalai@sib.swiss"
RECIPIENT="spsp-support@sib.swiss"
# Check for the machine compatibility
......@@ -110,7 +110,7 @@ signFile() {
encryptFile() {
message="Encrypting file ${COL_LGREEN}$1${COL_RESET}..."
printf "$message\n"
$GPGCMD -o $1.gpg -e -r $RECIPIENT $1
$GPGCMD --yes --always-trust -o $1.gpg -e -r $RECIPIENT $1
message="File is encrypted as ${COL_LYELLOW}$1.gpg${COL_RESET}!"
printf "$message\n"
}
......@@ -173,7 +173,7 @@ if [ $# -gt 0 ]; then
chmod +x spsp
echo "SPSP: Importing SPSP public key for encryption protocol..."
$GPGCMD --import .pub
$GPGCMD --import --always-trust .pub
echo ""
echo "SPSP: Complete!"
......@@ -213,14 +213,14 @@ if [ $# -gt 0 ]; then
if [ ! -f $LOGFILE ]; then
touch $LOGFILE
fi
echo "================================="
echo ""
for DIRECTORY in *; do
if [ -d "$DIRECTORY" ] && [ $DIRECTORY != $OUTBOX ] && [ $DIRECTORY != $SENT ] && [ $DIRECTORY != $LOGS ]; then
if [ -f $DIRECTORY/*.fastq* ] && [ -f $DIRECTORY/*.xlsx ]; then
echo "SPSP: Compressing $DIRECTORY folder..."
compressFolder $DIRECTORY &> /dev/null
echo "SPSP: Sucessfully compressed!"
echo "SPSP: Removing the source and moving the tar.gz to output folder."
echo "SPSP: Removing the source and moving the tar.gz to outbox folder."
# rm -rf $DIRECTORY
mv $DIRECTORY.tar.gz ./outbox/.
else
......@@ -230,7 +230,7 @@ if [ $# -gt 0 ]; then
fi
fi
done
echo "================================="
echo ""
for FILE in ./outbox/*; do
if [ -f "$FILE" ]; then
echo "SPSP: Signing $FILE using SHA-256 algorithm..."
......@@ -261,7 +261,7 @@ if [ $# -gt 0 ]; then
exit 0
fi
done
echo "================================="
echo ""
echo "SPSP: Process completed!"
# Compress a folder given as an input
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment