This commit is contained in:
ak 2023-11-10 08:33:18 +01:00
parent e88bb6e440
commit fa3a3a8731

23
sio2/CYBER/Cryptage/crypt.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
unn=$1
utilisateurmdp=$2
action=$3
ficcle=$4
user=$(echo $utilisateurmdp| cut -f1 -d/ )
mdp=$(echo $utilisateurmdp| cut -f2 -d/ )
echo $user
echo $mdp
[ -e /tmp/share ] || mkdir /tmp/share
mount.cifs -o "username=${user},password=${mdp}" //${unn} /tmp/share
if [[ $? == 0 ]] ;then
echo "le montage fonctionne cryptage en cours"
ccrypt ${action} -r -k ${ficcle} /tmp/share/*
umount /tmp/share
rm -r /tmp/share
else
echo "erreur montage $?"
exit 1
fi
exit 0