Subversion Repositories configs

Rev

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

Rev 12 Rev 57
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-2014         Tuomo Soini <tis@foobar.fi>
21
# Copyright (C) 2008-2015         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 118... Line 118...
118
    echo -n $"Starting pluto IKE daemon for IPsec: "
118
    echo -n $"Starting pluto IKE daemon for IPsec: "
119
    ipsec _stackmanager start
119
    ipsec _stackmanager start
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
    # Create nss db or convert from old format to new sql format
-
 
124
    ipsec --checknss
-
 
125
    # Enable nflog if configured
-
 
126
    ipsec --checknflog > /dev/null
123
    # This script will enter an endless loop to ensure pluto restarts on crash
127
    # This script will enter an endless loop to ensure pluto restarts on crash
124
    ipsec _plutorun --config ${IPSEC_CONF} --nofork ${PLUTO_OPTIONS} &
128
    ipsec _plutorun --config ${IPSEC_CONF} --nofork ${PLUTO_OPTIONS} &
125
    [ -d ${lockdir} ] || mkdir -p ${lockdir}
129
    [ -d ${lockdir} ] || mkdir -p ${lockdir}
126
    touch ${lockfile}
130
    touch ${lockfile}
127
    # Because _plutorun starts pluto at background we need to make sure pluto is started
131
    # Because _plutorun starts pluto at background we need to make sure pluto is started
Line 172... Line 176...
172
	RETVAL=$?
176
	RETVAL=$?
173
	[ ${RETVAL} -eq 0 ] && rm -f ${plutopid}
177
	[ ${RETVAL} -eq 0 ] && rm -f ${plutopid}
174
    fi
178
    fi
175
 
179
 
176
    ipsec _stackmanager stop
180
    ipsec _stackmanager stop
-
 
181
    ipsec --stopnflog > /dev/null
177
 
182
 
178
    # cleaning up backup resolv.conf
183
    # cleaning up backup resolv.conf
179
    if [ -e ${LIBRESWAN_RESOLV_CONF} ]; then
184
    if [ -e ${LIBRESWAN_RESOLV_CONF} ]; then
180
	if grep 'Libreswan' ${ORIG_RESOLV_CONF} > /dev/null 2>&1; then
185
	if grep 'Libreswan' ${ORIG_RESOLV_CONF} > /dev/null 2>&1; then
181
	    cp ${LIBRESWAN_RESOLV_CONF} ${ORIG_RESOLV_CONF}
186
	    cp ${LIBRESWAN_RESOLV_CONF} ${ORIG_RESOLV_CONF}
Line 230... Line 235...
230
	RETVAL=$?
235
	RETVAL=$?
231
	;;
236
	;;
232
    status)
237
    status)
233
	status -p ${plutopid} -l ${lockfile} ${IPSEC_EXECDIR}/pluto
238
	status -p ${plutopid} -l ${lockfile} ${IPSEC_EXECDIR}/pluto
234
	RETVAL=$?
239
	RETVAL=$?
-
 
240
	${IPSEC_EXECDIR}/whack --status | grep Total | sed 's/^000\ Total\ //'
235
	;;
241
	;;
236
    version)
242
    version)
237
	version
243
	version
238
	RETVAL=$?
244
	RETVAL=$?
239
	;;
245
	;;