]> git.hoellein.online Git - skripte/commitdiff
oisafe aespipe
authorMario Höllein <mhoellein@moellein.homeip.net>
Thu, 26 May 2016 13:02:36 +0000 (15:02 +0200)
committerMario Höllein <mhoellein@moellein.homeip.net>
Thu, 26 May 2016 13:02:36 +0000 (15:02 +0200)
oisafe/viaes [new file with mode: 0644]
oisafe/zeige [new file with mode: 0644]

diff --git a/oisafe/viaes b/oisafe/viaes
new file mode 100644 (file)
index 0000000..7b9d291
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/sh
+umask 0002
+PATH=
+CAT="/bin/cat"
+MKTEMP="/bin/mktemp"
+AESPIPE="/usr/bin/aespipe"
+VI="/usr/bin/vi"
+CP="/bin/cp"
+SHRED="/usr/bin/shred"
+
+BINARIES="$CAT $MKTEMP $AESPIPE $VI $CP $SHRED"
+
+for x in $BINARIES; do
+   if [ ! -x ${x} ]; then
+      echo "Programm ${x} fehlt!"
+      exit 1
+   fi
+done 
+
+if [ -e /media/SAVE/oisafe.csv.aes ]; then
+   BASE=/media/SAVE
+elif [ -e /run/media/mario/SAVE/oisafe.csv.aes ]; then
+   BASE=/run/media/mario/SAVE
+elif [ -e /run/media/mgoppold/SAVE/oisafe.csv.aes ]; then
+   BASE=/run/media/mgoppold/SAVE
+fi
+
+TMPFILE=`$MKTEMP /tmp/tfile.XXXXXXXXXX`
+$CAT $BASE/oisafe.csv.aes | $AESPIPE -K ~/.ck.asc -d > $TMPFILE
+if [ -s $TMPFILE ]; then
+   $VI -n -b $TMPFILE
+   $CP --force $BASE/oisafe.csv.aes.4 $BASE/oisafe.csv.aes.5
+   $CP --force $BASE/oisafe.csv.aes.3 $BASE/oisafe.csv.aes.4
+   $CP --force $BASE/oisafe.csv.aes.2 $BASE/oisafe.csv.aes.3
+   $CP --force $BASE/oisafe.csv.aes.1 $BASE/oisafe.csv.aes.2
+   $CP --force $BASE/oisafe.csv.aes   $BASE/oisafe.csv.aes.1
+   $CAT $TMPFILE | $AESPIPE -K ~/.ck.asc > $BASE/oisafe.csv.aes
+   OK=$?
+   if [ $OK -ne 0 ]; then
+      $CAT $TMPFILE | $AESPIPE -K ~/.ck.asc > $BASE/oisafe.csv.aes
+   fi 
+   echo -n "Weiter mit <RETURN> "
+   read II
+   $SHRED --force --remove $TMPFILE
+fi
diff --git a/oisafe/zeige b/oisafe/zeige
new file mode 100644 (file)
index 0000000..5f52bd8
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+if [ -e /media/SAVE/oisafe.csv.aes ]; then
+   cat /media/SAVE/oisafe.csv.aes | aespipe -K ~/.ck.asc -d | egrep -a -i "$1"
+elif [ -e /run/media/mario/SAVE/oisafe.csv.aes ]; then
+   cat /run/media/mario/SAVE/oisafe.csv.aes | aespipe -K ~/.ck.asc -d | egrep -a -i "$1"
+elif [ -e /run/media/mhoellein/SAVE/oisafe.csv.aes ]; then
+   cat /run/media/mhoellein/SAVE/oisafe.csv.aes | aespipe -K ~/.ck.asc -d | egrep -a -i "$1"
+elif [ -e /mnt/oisafe.csv.aes ]; then
+   cat /mnt/oisafe.csv.aes | aespipe -K ~/.ck.asc -d | egrep -a -i "$1"
+fi