/[gentoo-x86]/net-firewall/ipsec-tools/files/racoon.init.d
Gentoo

Contents of /net-firewall/ipsec-tools/files/racoon.init.d

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sat Apr 21 12:24:23 2007 UTC (7 years, 2 months ago) by dragonheart
Branch: MAIN
Changes since 1.4: +2 -2 lines
sercurity version bump as per bug #173219. Init script enhancement as per bug #151375. bug #152971 for major enhancements to this ebuild
(Portage version: 2.1.2.2)

1 #!/sbin/runscript
2 # Copyright 1999-2004 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 depend() {
6 before netmount
7 use net
8 }
9
10 checkconfig() {
11 if [ ! -e ${SETKEY_CONF} ] ; then
12 eerror "You need to configure setkey before starting racoon."
13 return 1
14 fi
15 if [ ! -e ${RACOON_CONF} ] ; then
16 eerror "You need a configuration file to start racoon."
17 return 1
18 fi
19 if [ ! -z ${RACOON_PSK_FILE} ] ; then
20 if [ ! -f ${RACOON_PSK_FILE} ] ; then
21 eerror "PSK file not found as specified."
22 eerror "Set RACOON_PSK_FILE in /etc/conf.d/racoon."
23 return 1
24 fi
25 case "`ls -Lldn ${RACOON_PSK_FILE}`" in
26 -r--------*)
27 ;;
28 *)
29 eerror "Your defined PSK file should be mode 400 for security!"
30 return 1
31 ;;
32 esac
33 fi
34 }
35
36 start() {
37 checkconfig || return 1
38 einfo "Loading ipsec policies from ${SETKEY_CONF}."
39 /usr/sbin/setkey -f ${SETKEY_CONF}
40 if [ $? -eq 1 ] ; then
41 eerror "Error while loading ipsec policies"
42 fi
43 ebegin "Starting racoon"
44 start-stop-daemon -S -x /usr/sbin/racoon -- -f ${RACOON_CONF} ${RACOON_OPTS}
45 eend $?
46 }
47
48 stop() {
49 ebegin "Stopping racoon"
50 start-stop-daemon -K -p /var/run/racoon.pid
51 eend $?
52 if [ -n "${RACOON_RESET_TABLES}" ]; then
53 ebegin "Flushing policy entries"
54 /usr/sbin/setkey -F
55 /usr/sbin/setkey -FP
56 eend $?
57 fi
58 }

  ViewVC Help
Powered by ViewVC 1.1.20