2 # generate new key for this host
3 # Copyright (C) 2001, 2002 Henry Spencer.
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the
7 # Free Software Foundation; either version 2 of the License, or (at your
8 # option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 # RCSID $Id: newhostkey,v 1.3.2.1 2002/04/09 21:34:56 mcr Exp $
18 usage="Usage: $me --output filename [--bits n] [--quiet] [--hostname host]
20 $me --output - [--bits n] [--quiet] [--verbose] [--hostname host] >filename"
29 --bits) bits="$2" ; shift ;;
31 --hostname) host="--hostname $2" ; shift ;;
32 --output) output="$2" ; shift ;;
33 --verbose) verbose=--verbose ;;
34 --version) echo "$me $IPSEC_VERSION" ; exit 0 ;;
35 --help) echo "$usage" ; exit 0 ;;
37 -*) echo "$me: unknown option \`$1'" >&2 ; exit 2 ;;
43 if test " $output" = " " && test ! -f ${IPSEC_CONFS}/ipsec.secrets
45 output=${IPSEC_CONFS}/ipsec.secrets
48 if test " $output" = " "
50 echo "$0: no --output specification included" >&2
52 elif test " $verbose" != " " -a " $output" != " -" -a -s "$output"
54 echo "$0: WARNING: file \`$output' exists, appending to it" >&2
59 ipsec rsasigkey $verbose $host $bits
61 echo '# do not change the indenting of that "}"'
63 if test " $output" = " -"