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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Sep 28 00:45:26 2012 UTC (21 months, 3 weeks ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Fix bug #435398 and #436144

(Portage version: 2.1.11.9/cvs/Linux x86_64)

1 #!/sbin/runscript
2 # Copyright 1999-2012 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 command=/usr/sbin/racoon
37 command_args="-f ${RACOON_CONF} ${RACOON_OPTS}"
38 pidfile=/var/run/racoon.pid
39 start_stop_daemon_args="--wait ${RACOON_WAIT}"
40
41 start_pre() {
42 checkconfig || return 1
43 einfo "Loading ipsec policies from ${SETKEY_CONF}."
44 /usr/sbin/setkey -f ${SETKEY_CONF}
45 if [ $? -eq 1 ] ; then
46 eerror "Error while loading ipsec policies"
47 fi
48 }
49
50 stop_post() {
51 if [ -n "${RACOON_RESET_TABLES}" ]; then
52 ebegin "Flushing policy entries"
53 /usr/sbin/setkey -F
54 /usr/sbin/setkey -FP
55 eend $?
56 fi
57 }

  ViewVC Help
Powered by ViewVC 1.1.20