How to use these simple script $ ./encryptdir.sh
$ ./decryptdir.sh Example
$ ./encryptdir.sh /home/narendra/test mypassword
$ ./decryptdir.sh /home/narendra/test mypassword ========== encryptdir.sh =========
#!/bin/bash
SOURCEDIR=$1
PASSWORD=$2
if [ -z $1 ]
then
echo "./encryptdir.sh "
exit 1
fi if [ -z $2 ]
then
echo "./encryptdir.sh "
exit 1
fi
find "$SOURCEDIR" -not -name "*.gpg" -type f -print |while read Filename ;
do
echo encrypting == "$Filename" ;
gpg -c --passphrase $PASSWORD "$Filename" ;
rm "$Filename";
done
exit 0
========== decryptdir.sh ==========
#!/bin/bash
SOURCEDIR=$1
PASSWORD=$2
if [ -z $1 ]
then
echo "./decryptdir.sh "
exit 1
fi if [ -z $2 ]
then
echo "./decryptdir.sh "
exit 1
fi
find "$SOURCEDIR" -name "*.gpg" -type f -print |while read Filename ;
do
echo encrypting == "$Filename" ;
gpg --passphrase $PASSWORD "$Filename" ;
rm "$Filename";
done
exit 0 ===============================================
┌─────────────────────────┐
│ Narendra Sisodiya ( नरेन्द्र सिसोदिया )
│ Society for Knowledge Commons
│ Web : http://narendra.techfandu.org
└─────────────────────────┘
$ ./decryptdir.sh Example
$ ./encryptdir.sh /home/narendra/test mypassword
$ ./decryptdir.sh /home/narendra/test mypassword ========== encryptdir.sh =========
#!/bin/bash
SOURCEDIR=$1
PASSWORD=$2
if [ -z $1 ]
then
echo "./encryptdir.sh "
exit 1
fi if [ -z $2 ]
then
echo "./encryptdir.sh "
exit 1
fi
find "$SOURCEDIR" -not -name "*.gpg" -type f -print |while read Filename ;
do
echo encrypting == "$Filename" ;
gpg -c --passphrase $PASSWORD "$Filename" ;
rm "$Filename";
done
exit 0
========== decryptdir.sh ==========
#!/bin/bash
SOURCEDIR=$1
PASSWORD=$2
if [ -z $1 ]
then
echo "./decryptdir.sh "
exit 1
fi if [ -z $2 ]
then
echo "./decryptdir.sh "
exit 1
fi
find "$SOURCEDIR" -name "*.gpg" -type f -print |while read Filename ;
do
echo encrypting == "$Filename" ;
gpg --passphrase $PASSWORD "$Filename" ;
rm "$Filename";
done
exit 0 ===============================================
┌─────────────────────────┐
│ Narendra Sisodiya ( नरेन्द्र सिसोदिया )
│ Society for Knowledge Commons
│ Web : http://narendra.techfandu.org
└─────────────────────────┘
No comments:
Post a Comment