Removed pluto-specifics from ipsec script

This commit is contained in:
Tobias Brunner
2012-06-25 10:52:16 +02:00
parent f5a3b95a39
commit 693805cc98
+1 -75
View File
@@ -30,14 +30,12 @@ IPSEC_CONFDIR="@IPSEC_CONFDIR@"
IPSEC_PIDDIR="@IPSEC_PIDDIR@" IPSEC_PIDDIR="@IPSEC_PIDDIR@"
IPSEC_STARTER_PID="${IPSEC_PIDDIR}/starter.pid" IPSEC_STARTER_PID="${IPSEC_PIDDIR}/starter.pid"
IPSEC_PLUTO_PID="${IPSEC_PIDDIR}/pluto.pid"
IPSEC_CHARON_PID="${IPSEC_PIDDIR}/charon.pid" IPSEC_CHARON_PID="${IPSEC_PIDDIR}/charon.pid"
IPSEC_WHACK="${IPSEC_DIR}/whack"
IPSEC_STROKE="${IPSEC_DIR}/stroke" IPSEC_STROKE="${IPSEC_DIR}/stroke"
IPSEC_STARTER="${IPSEC_DIR}/starter" IPSEC_STARTER="${IPSEC_DIR}/starter"
export IPSEC_DIR IPSEC_SBINDIR IPSEC_CONFDIR IPSEC_PIDDIR IPSEC_VERSION IPSEC_NAME IPSEC_STARTER_PID IPSEC_PLUTO_PID IPSEC_CHARON_PID export IPSEC_DIR IPSEC_SBINDIR IPSEC_CONFDIR IPSEC_PIDDIR IPSEC_VERSION IPSEC_NAME IPSEC_STARTER_PID IPSEC_CHARON_PID
IPSEC_DISTRO="Institute for Internet Technologies and Applications\nUniversity of Applied Sciences Rapperswil, Switzerland" IPSEC_DISTRO="Institute for Internet Technologies and Applications\nUniversity of Applied Sciences Rapperswil, Switzerland"
@@ -57,7 +55,6 @@ case "$1" in
echo " update|reload|stop" echo " update|reload|stop"
echo " up|down|route|unroute <connectionname>" echo " up|down|route|unroute <connectionname>"
echo " status|statusall [<connectionname>]" echo " status|statusall [<connectionname>]"
echo " ready"
echo " listalgs|listpubkeys|listcerts [--utc]" echo " listalgs|listpubkeys|listcerts [--utc]"
echo " listcacerts|listaacerts|listocspcerts [--utc]" echo " listcacerts|listaacerts|listocspcerts [--utc]"
echo " listacerts|listgroups|listcainfos [--utc]" echo " listacerts|listgroups|listcainfos [--utc]"
@@ -67,14 +64,11 @@ case "$1" in
echo " rereadcacerts|rereadaacerts|rereadocspcerts" echo " rereadcacerts|rereadaacerts|rereadocspcerts"
echo " rereadacerts|rereadcrls|rereadall" echo " rereadacerts|rereadcrls|rereadall"
echo " purgeocsp|purgecrls|purgecerts|purgeike" echo " purgeocsp|purgecrls|purgecerts|purgeike"
echo " scencrypt|scdecrypt <value> [--inbase <base>] [--outbase <base>] [--keyid <id>]"
echo " openac" echo " openac"
echo " pluto"
echo " scepclient" echo " scepclient"
echo " secrets" echo " secrets"
echo " starter" echo " starter"
echo " version" echo " version"
echo " whack"
echo " stroke" echo " stroke"
echo echo
echo "Some of these functions have their own manual pages, e.g. ipsec_scepclient(8)." echo "Some of these functions have their own manual pages, e.g. ipsec_scepclient(8)."
@@ -104,11 +98,6 @@ down)
exit 2 exit 2
fi fi
rc=7 rc=7
if [ -e $IPSEC_PLUTO_PID ]
then
$IPSEC_WHACK --name "$1" --terminate
rc="$?"
fi
if [ -e $IPSEC_CHARON_PID ] if [ -e $IPSEC_CHARON_PID ]
then then
$IPSEC_STROKE down "$1" $IPSEC_STROKE down "$1"
@@ -134,11 +123,6 @@ down-srcip)
listcards|rereadgroups) listcards|rereadgroups)
op="$1" op="$1"
shift shift
if [ -e $IPSEC_PLUTO_PID ]
then
$IPSEC_WHACK "$@" "--$op"
rc="$?"
fi
if [ -e $IPSEC_CHARON_PID ] if [ -e $IPSEC_CHARON_PID ]
then then
exit 3 exit 3
@@ -150,15 +134,6 @@ leases)
op="$1" op="$1"
rc=7 rc=7
shift shift
if [ -e $IPSEC_PLUTO_PID ]
then
case "$#" in
0) $IPSEC_WHACK "--$op" ;;
1) $IPSEC_WHACK "--$op" --name "$1" ;;
*) $IPSEC_WHACK "--$op" --name "$1" --lease-addr "$2" ;;
esac
rc="$?"
fi
if [ -e $IPSEC_CHARON_PID ] if [ -e $IPSEC_CHARON_PID ]
then then
case "$#" in case "$#" in
@@ -180,11 +155,6 @@ rereadall|purgeocsp)
op="$1" op="$1"
rc=7 rc=7
shift shift
if [ -e $IPSEC_PLUTO_PID ]
then
$IPSEC_WHACK "$@" "--$op"
rc="$?"
fi
if [ -e $IPSEC_CHARON_PID ] if [ -e $IPSEC_CHARON_PID ]
then then
$IPSEC_STROKE "$op" "$@" $IPSEC_STROKE "$op" "$@"
@@ -201,16 +171,6 @@ purgeike|purgecrls|purgecerts)
fi fi
exit "$rc" exit "$rc"
;; ;;
ready)
shift
if [ -e $IPSEC_PLUTO_PID ]
then
$IPSEC_WHACK --listen
exit 0
else
exit 7
fi
;;
reload) reload)
rc=7 rc=7
if [ -e $IPSEC_STARTER_PID ] if [ -e $IPSEC_STARTER_PID ]
@@ -237,11 +197,6 @@ route|unroute)
echo "Usage: ipsec $op <connection name>" echo "Usage: ipsec $op <connection name>"
exit 2 exit 2
fi fi
if [ -e $IPSEC_PLUTO_PID ]
then
$IPSEC_WHACK --name "$1" "--$op"
rc="$?"
fi
if [ -e $IPSEC_CHARON_PID ] if [ -e $IPSEC_CHARON_PID ]
then then
$IPSEC_STROKE "$op" "$1" $IPSEC_STROKE "$op" "$1"
@@ -249,24 +204,8 @@ route|unroute)
fi fi
exit "$rc" exit "$rc"
;; ;;
scencrypt|scdecrypt)
op="$1"
shift
if [ -e $IPSEC_PLUTO_PID ]
then
$IPSEC_WHACK "--$op" "$@"
exit "$?"
else
exit 7
fi
;;
secrets) secrets)
rc=7 rc=7
if [ -e $IPSEC_PLUTO_PID ]
then
$IPSEC_WHACK --rereadsecrets
rc="$?"
fi
if [ -e $IPSEC_CHARON_PID ] if [ -e $IPSEC_CHARON_PID ]
then then
$IPSEC_STROKE rereadsecrets $IPSEC_STROKE rereadsecrets
@@ -293,19 +232,11 @@ status|statusall)
shift shift
if [ $# -eq 0 ] if [ $# -eq 0 ]
then then
if [ -e $IPSEC_PLUTO_PID ]
then
$IPSEC_WHACK "--$op"
fi
if [ -e $IPSEC_CHARON_PID ] if [ -e $IPSEC_CHARON_PID ]
then then
$IPSEC_STROKE "$op" $IPSEC_STROKE "$op"
fi fi
else else
if [ -e $IPSEC_PLUTO_PID ]
then
$IPSEC_WHACK --name "$1" "--$op"
fi
if [ -e $IPSEC_CHARON_PID ] if [ -e $IPSEC_CHARON_PID ]
then then
$IPSEC_STROKE "$op" "$1" $IPSEC_STROKE "$op" "$1"
@@ -355,11 +286,6 @@ up)
exit 2 exit 2
fi fi
rc=7 rc=7
if [ -e $IPSEC_PLUTO_PID ]
then
$IPSEC_WHACK --name "$1" --initiate
rc="$?"
fi
if [ -e $IPSEC_CHARON_PID ] if [ -e $IPSEC_CHARON_PID ]
then then
$IPSEC_STROKE up "$1" $IPSEC_STROKE up "$1"