~ubuntu-branches/ubuntu/maverick/strongswan/maverick

« back to all changes in this revision

Viewing changes to src/ipsec/ipsec.in

  • Committer: Bazaar Package Importer
  • Author(s): Rene Mayrhofer
  • Date: 2008-12-05 17:21:42 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20081205172142-9g77wgyzcj0blq7p
* New upstream release, fixes a MOBIKE issue.
  Closes: #507542: strongswan: endless loop
* Explicitly enable compilation with libcurl for CRL fetching
  Closes: #497756: strongswan: not compiled with curl support; crl 
                   fetching not available
* Enable compilation with SSH agent support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15
15
# for more details.
16
16
#
17
 
# RCSID $Id: ipsec.in 3390 2007-12-12 22:27:40Z andreas $
 
17
# RCSID $Id: ipsec.in 4401 2008-10-10 06:59:03Z martin $
18
18
 
19
19
# define a minimum PATH environment in case it is not set
20
20
PATH="/sbin:/bin:/usr/sbin:/usr/bin:@IPSEC_SBINDIR@"
116
116
        fi
117
117
        exit "$rc"
118
118
        ;;
119
 
listalgs|listpubkeys|\listcards|\rereadgroups)
 
119
down-srcip)
 
120
        shift
 
121
        if [ "$#" -lt 1 ]
 
122
        then
 
123
            echo "Usage: ipsec down-srcip <start> [<end>]"
 
124
            exit 2
 
125
        fi
 
126
        rc=7
 
127
        if [ -e $IPSEC_CHARON_PID ]
 
128
        then
 
129
                $IPSEC_STROKE down-srcip $*
 
130
                rc="$?"
 
131
        fi
 
132
        exit "$rc"
 
133
        ;;
 
134
listcards|rereadgroups)
120
135
        op="$1"
121
136
        shift
122
137
        if [ -e $IPSEC_PLUTO_PID ]
123
138
        then
124
139
                $IPSEC_WHACK "$@" "--$op"
125
 
                exit "$?"
126
 
        else
127
 
                if [ -e $IPSEC_CHARON_PID ]
128
 
                then
129
 
                        exit 3
130
 
                else
131
 
                        exit 7
132
 
                fi
 
140
                rc="$?"
133
141
        fi
 
142
        if [ -e $IPSEC_CHARON_PID ] 
 
143
        then 
 
144
                exit 3 
 
145
        else 
 
146
                exit 7 
 
147
        fi 
134
148
        ;;
 
149
listalgs|\listpubkeys|\
135
150
listcerts|listcacerts|listaacerts|\
136
151
listacerts|listgroups|listocspcerts|\
137
152
listcainfos|listcrls|listocsp|listall|\
168
183
        if [ -e $IPSEC_STARTER_PID ]
169
184
        then
170
185
                echo "Reloading strongSwan IPsec configuration..." >&2
171
 
                kill -s USR1 `cat $IPSEC_STARTER_PID` 2>/dev/null && rc=0
 
186
                kill -USR1 `cat $IPSEC_STARTER_PID` 2>/dev/null && rc=0
172
187
        else
173
188
                echo "Reloading strongSwan IPsec failed: starter is not running" >&2
174
189
        fi
228
243
        ;;
229
244
start)
230
245
        shift
 
246
        if [ -d /var/lock/subsys ]; then
 
247
                touch /var/lock/subsys/ipsec
 
248
        fi
231
249
        exec $IPSEC_STARTER "$@"
232
250
        ;;
233
251
status|statusall)
278
296
                        kill $spid 2>/dev/null
279
297
                        loop=5
280
298
                        while [ $loop -gt 0 ] ; do
281
 
                                kill -s 0 $spid 2>/dev/null || break
 
299
                                kill -0 $spid 2>/dev/null || break
282
300
                                sleep 1
283
301
                                loop=$(($loop - 1))
284
302
                        done
285
303
                        if [ $loop -eq 0 ]
286
304
                        then
287
 
                                kill -s KILL $spid 2>/dev/null
 
305
                                kill -KILL $spid 2>/dev/null
288
306
                                rm -f $IPSEC_STARTER_PID
289
307
                        fi
290
308
                fi
291
309
        else
292
310
                echo "Stopping strongSwan IPsec failed: starter is not running" >&2
293
311
        fi
 
312
        if [ -d /var/lock/subsys ]; then
 
313
                rm -f /var/lock/subsys/ipsec
 
314
        fi
294
315
        exit 0
295
316
        ;;
296
317
up)
317
338
        if [ -e $IPSEC_STARTER_PID ]
318
339
        then
319
340
                echo "Updating strongSwan IPsec configuration..." >&2
320
 
                kill -s HUP `cat $IPSEC_STARTER_PID`
 
341
                kill -HUP `cat $IPSEC_STARTER_PID`
321
342
                exit 0
322
343
        else
323
344
                echo "Updating strongSwan IPsec failed: starter is not running" >&2
325
346
        fi
326
347
        ;;
327
348
version|--version)
328
 
        echo "Linux $IPSEC_NAME $IPSEC_VERSION"
 
349
        printf "Linux $IPSEC_NAME $IPSEC_VERSION\n"
329
350
        printf "$IPSEC_DISTRO\n"
330
 
        echo "See \`ipsec --copyright' for copyright information."
 
351
        printf "See 'ipsec --copyright' for copyright information.\n"
331
352
        exit 0
332
353
        ;;
333
354
--*)