summaryrefslogtreecommitdiff
path: root/scripts/fskprotect.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/fskprotect.sh')
-rwxr-xr-xscripts/fskprotect.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/fskprotect.sh b/scripts/fskprotect.sh
new file mode 100755
index 0000000..8e9a78b
--- /dev/null
+++ b/scripts/fskprotect.sh
@@ -0,0 +1,34 @@
+
+fskcheck check
+
+if [ $? != 1 ]; then
+ fskcheck info "Please enable pin protection first"
+ exit 1
+fi
+
+if [ "$1" == "protect" ]; then
+
+ if [ -f $2/protection.fsk ]; then
+ fskcheck info "Recording was already protected!"
+ exit 1
+ fi
+
+ touch $2/protection.fsk
+ fskcheck info "Recording now protected!"
+
+fi
+
+if [ "$1" == "unprotect" ]; then
+
+ if [ ! -f $2/protection.fsk ]; then
+ echo fskcheck info "Recording was not protected!"
+ exit 1
+ fi
+
+ rm -f $2/protection.fsk
+ fskcheck info "Removed protection of recording!"
+
+fi
+
+exit 0
+