lookup of private key based on keyid of public key
[strongswan.git] / src / ipsec / ipsec.in
index 9c4ec47..7ed1286 100755 (executable)
@@ -96,6 +96,11 @@ case "$1" in
        ;;
 down)
        shift
+       if [ "$#" -ne 1 ]
+       then
+           echo "Usage: ipsec down <connection name>"
+           exit 1
+       fi
        if test -e $IPSEC_PLUTO_PID
        then
                $IPSEC_WHACK --name "$1" --terminate
@@ -106,10 +111,10 @@ down)
        fi
        exit 0
        ;;
-listalgs|listpubkeys|listcerts|listcacerts|\
-listaacerts|listocspcerts|listacerts|listgroups|\
+listalgs|listpubkeys|listcacerts|listaacerts|\
+listocspcerts|listacerts|listgroups|\
 listcainfos|listcrls|listocsp|listcards|\
-listall|purgeocsp|rereadsecrets|rereadgroups|\
+purgeocsp|rereadsecrets|rereadgroups|\
 rereadcacerts|rereadaacerts|rereadocspcerts|\
 rereadacerts|rereadcrls|rereadall)
        op="$1"
@@ -118,10 +123,18 @@ rereadacerts|rereadcrls|rereadall)
        then
                $IPSEC_WHACK "$@" "--$op"
        fi
-       #if test -e $IPSEC_CHARON_PID
-       #then
-       #       $IPSEC_STROKE "$op"
-       #fi
+       ;;
+listcerts|listall)
+       op="$1"
+       shift
+       if test -e $IPSEC_PLUTO_PID
+       then
+               $IPSEC_WHACK "$@" "--$op"
+       fi
+       if test -e $IPSEC_CHARON_PID
+       then
+               $IPSEC_STROKE "$op"
+       fi
        exit 0
        ;;
 ready)
@@ -152,6 +165,11 @@ restart)
 route|unroute)
        op="$1"
        shift
+       if [ "$#" -ne 1 ]
+       then
+           echo "Usage: ipsec $op <connection name>"
+           exit 1
+       fi
        if test -e $IPSEC_PLUTO_PID
        then
                $IPSEC_WHACK --name "$1" "--$op"
@@ -215,6 +233,11 @@ stop)
        ;;
 up)
        shift
+       if [ "$#" -ne 1 ]
+       then
+           echo "Usage: ipsec up <connection name>"
+           exit 1
+       fi
        if test -e $IPSEC_PLUTO_PID
        then
                $IPSEC_WHACK --name "$1" --initiate