From 56dc9020d04fdca867a4fa415ef01cc38e8b759e Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sun, 9 Jun 2002 11:28:01 +0000 Subject: [PATCH] upload.sh: Add file --- scripts/upload.sh | 80 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 scripts/upload.sh diff --git a/scripts/upload.sh b/scripts/upload.sh new file mode 100644 index 00000000..185d067d --- /dev/null +++ b/scripts/upload.sh @@ -0,0 +1,80 @@ +#!/bin/sh +######################################################################## +# # +# generic utiltiy modules # +# (c) 2001 jannet it services # +# contact@jannet.de # +# # +# $Id$ +# # +# This program is free software; permission to use, copy, modify, # +# distribute, and sell this software and its documentation under the # +# terms of the GNU Public license as published by the Free Software # +# Foundation, either version 2 or any later version of the license, is # +# hereby granted without fee, provided that (i) the above copyright # +# notices and this permission notice appear in all copies of the # +# software and related documentation, and (ii) the name of JanNet may # +# not be used in any advertising or publicity relating to the software # +# without the specific, prior written permission of JanNet. # +# # +# This program is distributed in the hope that it will be useful, but # +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- # +# TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # +# Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software Founda- # +# tion, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # +# # +######################################################################## + + +MYNAME=`basename $0` +HOST=ftp.jannet.de +CFG_FILE=$HOME/.uploadrc + +method=rsync_ssh +pw_ftp= +pw_scp=$HOME/.ssh/identity +pw_rsync= +pw_rsync_ssh=$HOME/.ssh/identity +file_mode= +dir_mode= +file_owner= +file_group= + +test -f $CFG_FILE && . $CFG_FILE + +usage() +{ +cat << EOT + + Unified Upload Interface + Version '$Revision$' - '$Date$' + (c) 2002 Jannet IT Services + + usage: $MYNAME file [password:[method:]]user@host:/path/to/directory[:mode[:dirmode[:owner.group]]] ... + + where "method" is one of "ftp", "scp", "rsync", "rsync_ssh". + "password" may be a valid rsa private key file, too, if this makes sense with the chosen method. + + The default values for the optional parameters may be redefined in $CFG_FILE. + + Currently they are: + + method="$method" + pw_ftp="$pw_ftp" + pw_scp="$pw_scp" + pw_rsync="$pc_rsync" + pw_rsync_ssh="$pw_rsync_ssh" + file_mode="$file_mode" + dir_mode="$dir_mode" + file_owner="$file_owner" + file_group="$file_group" + +EOT + [ -n "$1" ] && exit $1 +} + +# -- here we go +test $# -lt 2 && usage 1