bb1432f11af26fc23261743fe2e3296aa6d173ee
commit bb1432f11af26fc23261743fe2e3296aa6d173ee
Author: Simon Watson <esko997@gmail.com>
Date: Sat Nov 10 13:07:20 2018 -0500

Added decrypt

diff --git a/decrypt b/decrypt
new file mode 100755
index 0000000..eea240f
--- /dev/null
+++ b/decrypt
@@ -0,0 +1,34 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $file;
+if ( ! defined $ARGV[0] ) {
+ print "Enter file path to decrypt: ";
+ my $input = <STDIN>;
+ chomp $input;
+ $file = $input;
+} else {
+ # Expects full path of file
+ $file = $ARGV[0];
+}
+
+if ( ! -f $file ) { die "File argument must be a plain file, $file is not a plain file or it cannot be found, exiting...\n" };
+# Get rid of .gpg
+my $newFileName = $file;
+for ( 0 .. 3 ) {
+ my $char = chop($newFileName);
+}
+
+print "new filename is $newFileName\n";
+system("gpg -o $newFileName -d $file") == 0 or die "Something went wrong with GPG, I didn't decrypt the file...";
+
+print "Looking for decrypted file..\n";
+if ( -f $newFileName ) {
+ print "Unencrypted file is at: $newFileName\n";
+} else {
+ print "Something went wrong? I couldn't find the decrypted file, maybe check the dir?\n";
+ exit 1;
+}
+