Changed the working prinzimple
This commit is contained in:
parent
0e6b022e03
commit
a3d3f4c263
31
do-plication
31
do-plication
@ -4,38 +4,37 @@ if [ "$1" = "-h" ]
|
||||
then
|
||||
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 "Options:"
|
||||
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 "-f Override the n'th arcive"
|
||||
echo "-l Load the n'th arcive"
|
||||
echo
|
||||
echo "-e enable encription {do-plication -e [path to key file] [ key file descriptoin(only if key not alreadey created)}"
|
||||
echo
|
||||
echo "Enable/Disable Encryprion"
|
||||
echo "-e Encrypt "
|
||||
echo "-n noEncrypt"
|
||||
echo
|
||||
echo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$2" = "-e" ]
|
||||
if [ "$1" = "-e" ]
|
||||
then
|
||||
sudo ls "$4" > /dev/null
|
||||
if [ $? == 0 ]
|
||||
then
|
||||
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
|
||||
echo "key not fount creating key"
|
||||
sudo stenc -g 256 -k "$5" -kd "$6";
|
||||
sudo stenc -f /dev/nst0 -e on -k "$5" -a 1 --ckod
|
||||
sudo stenc -g 256 -k "$2" -kd "$3";
|
||||
sudo stenc -f /dev/nst0 -e on -k "$2" -a 1 --ckod
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
fi
|
||||
# Going to the right directory
|
||||
# cd /media
|
||||
|
||||
@ -50,21 +49,21 @@ case "$1" in
|
||||
;;
|
||||
|
||||
-c)
|
||||
sudo mt -f /dev/nst0 asf "$3";
|
||||
sudo mt -f /dev/nst0 asf "$2";
|
||||
sudo tar tvf /dev/st0
|
||||
true
|
||||
;;
|
||||
|
||||
-f)
|
||||
sudo mt -f /dev/nst0 asf "$3";
|
||||
echo "your arcive wil be $3";
|
||||
sudo screen -dmS do-plication tar -cvf /dev/nst0 "$4"
|
||||
sudo mt -f /dev/nst0 asf "$2";
|
||||
echo "your arcive wil be $2";
|
||||
sudo screen -dmS do-plication tar -cvf /dev/nst0 "$3"
|
||||
true
|
||||
;;
|
||||
|
||||
-l)
|
||||
sudo mt -f /dev/nst0 asf "$3";
|
||||
sudo screen -dmS do-plication tar xvf /dev/nst0 -C "$4"
|
||||
sudo mt -f /dev/nst0 asf "$2";
|
||||
sudo screen -dmS do-plication tar xvf /dev/nst0 -C "$3"
|
||||
true
|
||||
esac
|
||||
exit $?
|
Loading…
Reference in New Issue
Block a user