Commit ddbc1f0e authored by Dillenn Terumalai's avatar Dillenn Terumalai 🏠

Fixed some small issues

- remove signing using GPG
- fixed wrong path while moving files
- fixed --no-archive
parent 5fae4785
Pipeline #1206 passed with stage
in 2 minutes and 45 seconds
......@@ -137,7 +137,7 @@ The following commands are available:
- `./spsp compress <folder>` - compress a folder to tar.gz archive
- `./spsp encrypt <file>` - encrypts a file using gpg command and SPSP public key (which needs to be in your own GPG keys list)
- `./spsp transfer <file>` - transfers a file through sftp to SPSP server (your SSH key needs to be validated by SPSP to use this command)
- `./spsp auto`- automatically run the transfer-tool (this needs to be combined with a CRON task, see below for more information), add `--no-archive` or `no-archive` to keep the sent files
- `./spsp auto`- automatically run the transfer-tool (this needs to be combined with a CRON task, see below for more information), add `--no-archive` or `-NA` to keep the sent files
- `./spsp help` - displays the help
For more information, don't hesite to type:
......
......@@ -2,7 +2,7 @@
# SPSP transfer-tool is developped and maintained by SIB. For more informations, please contact spsp-support@sib.swiss
VERSION="1.1.0" # bumped to support spsp --help, spsp --version
VERSION="1.1.1" # bumped to support spsp --help, spsp --version
# Define colors that are used in the help screen
......@@ -124,7 +124,7 @@ signFile() {
encryptFile() {
message="Encrypting file ${COL_LGREEN}$1${COL_RESET}..."
printf "$message\n"
$GPGCMD --batch --yes --always-trust --sign --armor -o $1.gpg -e -r $RECIPIENT $1
$GPGCMD --batch --yes --always-trust -o $1.gpg -e -r $RECIPIENT $1
message="File is encrypted as ${COL_LYELLOW}$1.gpg${COL_RESET}!"
printf "$message\n"
}
......@@ -323,14 +323,14 @@ autoMode() {
echo "SPSP: Removing unencrypted version of $FILE..."
rm $FILE
echo "SPSP: Deleted!"
if [ "$1" == "--no-archive" ] || [ "$1" == "no-archive" ]; then
if [[ "$@" == *--no-archive* ]] || [[ "$@" == *-NA* ]]; then
echo "SPSP: 'No archive' mode is activated, removing archives..."
rm $FILE.gpg
rm $FILE.sha256
else
echo "SPSP: Moving $FILE.gpg and $FILE.sha256 to '$SENT' directory!"
mv $FILE.sha256 ./$SENT
mv $FILE.gpg ./$SENT
mv $FILE.sha256 ../../$SENT
mv $FILE.gpg ../../$SENT
echo "SPSP: Archives have been moved sucessfully!"
fi
else
......@@ -363,14 +363,14 @@ autoMode() {
echo "SPSP: Removing unencrypted version of $FILE..."
rm $FILE
echo "SPSP: Deleted!"
if [ "$1" == "--no-archive" ] || [ "$1" == "no-archive" ]; then
if [[ "$@" == *--no-archive* ]] || [[ "$@" == *-NA* ]]; then
echo "SPSP: 'No archive' mode is activated, removing archives..."
rm $FILE.gpg
rm $FILE.sha256
else
echo "SPSP: Moving $FILE.gpg and $FILE.sha256 to '$SENT' directory!"
mv $FILE.sha256 ./$SENT
mv $FILE.gpg ./$SENT
mv $FILE.sha256 ../../$SENT
mv $FILE.gpg ../../$SENT
echo "SPSP: Archives have been moved sucessfully!"
fi
else
......
Markdown is supported
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