Subversion Repositories configs

Rev

Rev 6 | Rev 57 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 12
Line 16... Line 16...
16
 
16
 
17
# Copyright (C) 1998, 1999, 2001  Henry Spencer.
17
# Copyright (C) 1998, 1999, 2001  Henry Spencer.
18
# Copyright (C) 2002              Michael Richardson <mcr@freeswan.org>
18
# Copyright (C) 2002              Michael Richardson <mcr@freeswan.org>
19
# Copyright (C) 2006              Michael Richardson <mcr@xelerance.com>
19
# Copyright (C) 2006              Michael Richardson <mcr@xelerance.com>
20
# Copyright (C) 2008              Michael Richardson <mcr@sandelman.ca>
20
# Copyright (C) 2008              Michael Richardson <mcr@sandelman.ca>
21
# Copyright (C) 2008-2011, 2013   Tuomo Soini <tis@foobar.fi>
21
# Copyright (C) 2008-2014         Tuomo Soini <tis@foobar.fi>
22
# Copyright (C) 2012              Paul Wouters <paul@libreswan.org>
22
# Copyright (C) 2012              Paul Wouters <paul@libreswan.org>
23
#
23
#
24
# This program is free software; you can redistribute it and/or modify it
24
# This program is free software; you can redistribute it and/or modify it
25
# under the terms of the GNU General Public License as published by the
25
# under the terms of the GNU General Public License as published by the
26
# Free Software Foundation; either version 2 of the License, or (at your
26
# Free Software Foundation; either version 2 of the License, or (at your
Line 120... Line 120...
120
 
120
 
121
    # pluto searches the current directory, so this is required for making it selinux compliant
121
    # pluto searches the current directory, so this is required for making it selinux compliant
122
    cd /
122
    cd /
123
    # This script will enter an endless loop to ensure pluto restarts on crash
123
    # This script will enter an endless loop to ensure pluto restarts on crash
124
    ipsec _plutorun --config ${IPSEC_CONF} --nofork ${PLUTO_OPTIONS} &
124
    ipsec _plutorun --config ${IPSEC_CONF} --nofork ${PLUTO_OPTIONS} &
-
 
125
    [ -d ${lockdir} ] || mkdir -p ${lockdir}
-
 
126
    touch ${lockfile}
-
 
127
    # Because _plutorun starts pluto at background we need to make sure pluto is started
-
 
128
    # before we know if start was successful or not
-
 
129
    for waitsec in 1 2 3 4 5; do
-
 
130
	if status -p ${plutopid} -l ${lockfile} ${IPSEC_EXECDIR}/pluto >/dev/null; then
125
    RETVAL=$?
131
	    RETVAL=0
-
 
132
	    break
-
 
133
	else
-
 
134
	    echo -n "."
-
 
135
	    sleep 1
-
 
136
	    RETVAL=1
-
 
137
	fi
-
 
138
    done
126
    if [ ${RETVAL} -eq 0 ]; then
139
    if [ ${RETVAL} -eq 0 ]; then
127
	success
140
	success
128
	[ -d ${lockdir} ] || mkdir -p ${lockdir}
-
 
129
	touch ${lockfile}
-
 
130
    else
141
    else
-
 
142
	rm -f ${lockfile}
131
	failure
143
	failure
132
    fi
144
    fi
133
    echo
145
    echo
134
    return ${RETVAL}
146
    return ${RETVAL}
135
}
147
}