diff options
author | horchi <vdr@jwendel.de> | 2017-03-05 16:48:30 +0100 |
---|---|---|
committer | horchi <vdr@jwendel.de> | 2017-03-05 16:48:30 +0100 |
commit | bf558fd824c7ab8c794448f718b364ad403a706a (patch) | |
tree | e0ba2269c08ccc9c9bd9c336df06b1fa6fce5ec6 /scripts | |
download | vdr-plugin-pin-0.1.16.tar.gz vdr-plugin-pin-0.1.16.tar.bz2 |
git init0.1.16
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/cut.sh | 14 | ||||
-rwxr-xr-x | scripts/fskcheck-demo.sh | 23 | ||||
-rwxr-xr-x | scripts/fskprotect.sh | 34 | ||||
-rwxr-xr-x | scripts/getSetupMenues | 8 |
4 files changed, 79 insertions, 0 deletions
diff --git a/scripts/cut.sh b/scripts/cut.sh new file mode 100755 index 0000000..3b4a1db --- /dev/null +++ b/scripts/cut.sh @@ -0,0 +1,14 @@ +# +# Copy FSK protection of the PIN plugin when cutting a protected recording +# + +if [ $1 == "edited" ]; then + target_recording="$2" + source_recording=`echo $2 | sed s/"%"/""/ ` + protection_file="$source_recording/protection.fsk" + + if [ -e "$protection_file" ]; then + cp "$protection_file" "$target_recording/" + fi +fi + diff --git a/scripts/fskcheck-demo.sh b/scripts/fskcheck-demo.sh new file mode 100755 index 0000000..02aa17e --- /dev/null +++ b/scripts/fskcheck-demo.sh @@ -0,0 +1,23 @@ + + +./fskcheck check + +case "$?" in + 0) + echo "check went wrong" + ;; + + 1) + echo "not protected" + ;; + + 2) + echo "protected" + ./fskcheck info "Can't execute script due to pin protection" + ;; + + *) + echo "unexpected return code" + ;; + +esac 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 + diff --git a/scripts/getSetupMenues b/scripts/getSetupMenues new file mode 100755 index 0000000..ea46edd --- /dev/null +++ b/scripts/getSetupMenues @@ -0,0 +1,8 @@ + +cat $1 | awk 'BEGIN { insidecom=0; } + /[<][!][-][-]/ { insidecom=1; } + /[-][-][>]/ { insidecom=0; } + /^[^-]/ { if (!insidecom) { printf( "%s\n", $0); begin=0 } }' | \ +egrep "<(system|menu|command) " | sed s/"^.* name=\""/""/ | sed s/"\".*"/""/ | sort | uniq | awk '{ printf("%s:no:0000:2359:%s:exact\n", $0, $0) }' + + |