Changed the working prinzimple

This commit is contained in:
Erik Foris 2021-01-06 21:33:00 +00:00
parent 0e6b022e03
commit a3d3f4c263

View File

@ -4,38 +4,37 @@ if [ "$1" = "-h" ]
then then
echo echo
echo echo
echo "do-plication <option> <enable/disable Encryprion> <n> [directory to back up] [path to key file] [ key file descriptoin(only if key not alreadey created) ]" echo "do-plication <option> (<n>) [directory to back up]"
echo echo
echo "Options:" echo "Options:"
echo echo
echo "-a append arcive to the back of the tape put 0 as n" echo "-a append arcive to the back of the tape no n needed"
echo "-c checks (lists) the contents of the n'th arcive put - as argument for directory to back up " echo "-c checks (lists) the contents of the n'th arcive put - as argument for directory to back up "
echo "-f Override the n'th arcive" echo "-f Override the n'th arcive"
echo "-l Load the n'th arcive" echo "-l Load the n'th arcive"
echo echo
echo "-e enable encription {do-plication -e [path to key file] [ key file descriptoin(only if key not alreadey created)}"
echo echo
echo "Enable/Disable Encryprion"
echo "-e Encrypt "
echo "-n noEncrypt"
echo echo
echo echo
exit 0 exit 0
fi fi
if [ "$2" = "-e" ] if [ "$1" = "-e" ]
then then
sudo ls "$4" > /dev/null sudo ls "$4" > /dev/null
if [ $? == 0 ] if [ $? == 0 ]
then then
echo "key fount using key" echo "key fount using key"
sudo stenc -f /dev/nst0 -e on -k "$5" -a 1 --ckod sudo stenc -f /dev/nst0 -e on -k "$2" -a 1 --ckod
else else
echo "key not fount creating key" echo "key not fount creating key"
sudo stenc -g 256 -k "$5" -kd "$6"; sudo stenc -g 256 -k "$2" -kd "$3";
sudo stenc -f /dev/nst0 -e on -k "$5" -a 1 --ckod sudo stenc -f /dev/nst0 -e on -k "$2" -a 1 --ckod
fi
exit 0
fi fi
fi
# Going to the right directory # Going to the right directory
# cd /media # cd /media
@ -50,21 +49,21 @@ case "$1" in
;; ;;
-c) -c)
sudo mt -f /dev/nst0 asf "$3"; sudo mt -f /dev/nst0 asf "$2";
sudo tar tvf /dev/st0 sudo tar tvf /dev/st0
true true
;; ;;
-f) -f)
sudo mt -f /dev/nst0 asf "$3"; sudo mt -f /dev/nst0 asf "$2";
echo "your arcive wil be $3"; echo "your arcive wil be $2";
sudo screen -dmS do-plication tar -cvf /dev/nst0 "$4" sudo screen -dmS do-plication tar -cvf /dev/nst0 "$3"
true true
;; ;;
-l) -l)
sudo mt -f /dev/nst0 asf "$3"; sudo mt -f /dev/nst0 asf "$2";
sudo screen -dmS do-plication tar xvf /dev/nst0 -C "$4" sudo screen -dmS do-plication tar xvf /dev/nst0 -C "$3"
true true
esac esac
exit $? exit $?