From bf558fd824c7ab8c794448f718b364ad403a706a Mon Sep 17 00:00:00 2001 From: horchi Date: Sun, 5 Mar 2017 16:48:30 +0100 Subject: git init --- scripts/fskprotect.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 scripts/fskprotect.sh (limited to 'scripts/fskprotect.sh') 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 + -- cgit v1.2.3