about summary refs log tree commit diff
path: root/functions/gpg_functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'functions/gpg_functions.sh')
-rw-r--r--functions/gpg_functions.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/functions/gpg_functions.sh b/functions/gpg_functions.sh
index 267c40105000..92762a5bde1c 100644
--- a/functions/gpg_functions.sh
+++ b/functions/gpg_functions.sh
@@ -1,5 +1,6 @@
 #!/usr/bin/env zsh
 
+# wip
 function gpg-encrypt-dir() {
     dirname=$1
     echo "Encrypting..."
@@ -8,6 +9,7 @@ function gpg-encrypt-dir() {
 }
 
 
+# wip
 function gpg-decrypt-dir() {
     dirname=$1
     outdir=${dirname%.tar.gz.gpg}
@@ -24,19 +26,23 @@ function gpg-decrypt-dir() {
 }
 
 
-# WIP
+# encrypts a file, appending a .gpg extension
+# deletes the non-encrypted source
 function gpg-encrypt-file() {
     filename=$1
-    echo "Encrypting..."
-    gpg --symmetric $filename
+    echo "Encrypting..." && \
+    gpg --symmetric ${filename} && \
+    rm ${filename} && \
     echo "Done."
 }
 
 
-# WIP
+# decrypts a file
+# deletes the original encrypted file with the .gpg extension
 function gpg-decrypt-file() {
     filename=$1
-    echo "Decrypting..."
-    gpg --decrypt $filename >"${filename%.gpg}"
+    echo "Decrypting..." && \
+    gpg --decrypt ${filename} >"${filename%.gpg}" && \
+    rm ${filename} && \
     echo "Done."
 }