Skip to content

Commit

Permalink
Merge pull request #8 from Gu1llaum-3/feature/askRm
Browse files Browse the repository at this point in the history
Update cryptr.bash
  • Loading branch information
nodesocket authored Jul 30, 2024
2 parents 77d39c1 + d3697ab commit cbad61d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cryptr.bash
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ cryptr_encrypt() {
else
openssl $OPENSSL_CIPHER_TYPE -salt -pbkdf2 -in "$_file" -out "${_file}.aes"
fi

if [[ $? -eq 0 ]]; then
read -p "Do you want to delete the original file? (y/N): " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
echo "[notice] deleting the original file"
rm -f "$_file"
fi
else
echo "[error] encryption failed, original file not deleted" 1>&2
exit 6
fi
}

cryptr_decrypt() {
Expand Down

0 comments on commit cbad61d

Please sign in to comment.