#!/bin/bash #estuffdir - a script to encrypt a directory #Copyright (C) 2005 Daniel Brewer #This program is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License #as published by the Free Software Foundation; either version 2 #of the License, or (at your option) any later version. #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. #http://www.gnu.org/copyleft/gpl.html key="a@example.com" if [ $# -gt 0 ] then name=$1 else name="`pwd | sed 's/.*\///'`" echo $name exit fi tar -c -f $name.tar * gpg --encrypt-files -r $key $name.tar rm $name.tar mv $name.tar.gpg $HOME rm -rf * mv $HOME/$name.tar.gpg .