commit 57087a54d4c95d5ae12f9c5084ebd7b43e71d739
Author: Simon Waton <spw01@protonmail.com>
Date: Tue Nov 13 22:24:52 2018 -0500
Mount script
diff --git a/hddOp b/hddOp
new file mode 100755
index 0000000..813d8d1
--- /dev/null
+++ b/hddOp
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $disk = "/dev/sdb1";
+my $volume = "hddVolume";
+my $mountpoint = "/mnt/hddDisk";
+
+if ( ! defined $ARGV[0] ) {
+ print "Pass either --mount or --umount\n";
+ exit 1;
+}
+
+my $opt = $ARGV[0];
+
+if ( $opt eq "mount" ) {
+ system("sudo cryptsetup luksOpen $disk $volume");
+ system("sudo mount /dev/mapper/$volume $mountpoint");
+} elsif ( $opt eq "umount" ) {
+ system("sudo umount $mountpoint");
+ system("sudo cryptsetup luksClose /dev/mapper/$volume");
+} else {
+ print "Did not recognize opt, exiting...\n";
+}