2 # prefix command to run stuff from our programs directory
3 # Copyright (C) 1998-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: ipsec.in,v 1.21 2002/03/26 17:49:43 henry Exp $
17 # where the private directory and the config files are
19 IPSEC_CONFS=@IPSEC_CONFS@
20 export IPSEC_DIR IPSEC_CONFS
22 # standardize PATH, and export it for everything else's benefit
23 PATH=/usr/local/sbin:/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin
26 # things not to be listed in --help command list
27 DONTMENTION='^(ipsec|_.*|.*\.old|.*~)$'
29 # version numbering (details filled in by build)
30 # Possibly should call a C program to invoke the version_code() function
31 # instead, but for performance's sake, we inline it here (and only here).
34 # export the version information
35 IPSEC_VERSION="$version"
38 # function for the funky user/kernel version stuff
40 if test -f /proc/net/ipsec_version
42 kv="`awk '{print $NF}' /proc/net/ipsec_version`"
43 if test " $kv" != " $version"
45 version="U$version/K$kv"
52 echo "Usage: ipsec command argument ..."
53 echo "Use --help for list of commands, or see ipsec(8) manual page"
54 echo "or the FreeS/WAN documentation for names of the common ones."
55 echo "Most have their own manual pages, e.g. ipsec_auto(8)."
56 echo "See <http://www.freeswan.org> for more general info."
60 echo "Usage: ipsec command argument ..."
61 echo "where command is one of:"
62 for f in `ls $IPSEC_DIR | egrep -v -i "$DONTMENTION"`
64 if test -x $IPSEC_DIR/$f
70 echo "Most of these have their own manual pages, e.g. ipsec_auto(8)."
71 echo "See also <http://www.freeswan.org> or the ipsec(8) manual page."
76 echo "Linux FreeS/WAN $version"
77 echo "See \`ipsec --copyright' for copyright information."
87 # and fall through, invoking "ipsec _copyright"
98 echo "$0: unknown option \`$1' (perhaps command name was omitted?)" >&2
105 path="$IPSEC_DIR/$cmd"
109 echo "$0: unknown IPsec command \`$cmd' (\`ipsec --help' for list)" >&2