#!/bin/bash #estuff - a script to encrypt a group of files into one package #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 [ $# == 0 ] then echo "$0 : You must supply at least one file to encrypt" exit 0 fi for file in "$@" do if [ ! -s $file -a ! -d $file ] then echo "$file does not exist" exit 0 fi done echo "Please enter an archive name (default is `echo $1 | sed 's/\..*//'`): " read name if [ -z $name ] then name="`echo $1 | 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 .