diff options
author | 2017-03-17 14:49:18 +0100 | |
---|---|---|
committer | 2017-03-17 14:56:14 +0100 | |
commit | 7f68c86d93d5f69d775bceb3941b3a3b46672eb1 (patch) | |
tree | b461a335b70f8d07bda55ab1e3cc54fbd568a097 /net-vpn/ipsec-tools/files/racoon.init.d-r3 | |
parent | dev-ruby/nexpose: Initial version (diff) | |
download | gentoo-7f68c86d93d5f69d775bceb3941b3a3b46672eb1.tar.gz gentoo-7f68c86d93d5f69d775bceb3941b3a3b46672eb1.tar.bz2 gentoo-7f68c86d93d5f69d775bceb3941b3a3b46672eb1.zip |
Move VPN packages into net-vpn/
Diffstat (limited to 'net-vpn/ipsec-tools/files/racoon.init.d-r3')
-rw-r--r-- | net-vpn/ipsec-tools/files/racoon.init.d-r3 | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/net-vpn/ipsec-tools/files/racoon.init.d-r3 b/net-vpn/ipsec-tools/files/racoon.init.d-r3 new file mode 100644 index 000000000000..66e10bb84d42 --- /dev/null +++ b/net-vpn/ipsec-tools/files/racoon.init.d-r3 @@ -0,0 +1,57 @@ +#!/sbin/openrc-run +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + before netmount + use net +} + +checkconfig() { + if [ ! -e ${SETKEY_CONF} ] ; then + eerror "You need to configure setkey before starting racoon." + return 1 + fi + if [ ! -e ${RACOON_CONF} ] ; then + eerror "You need a configuration file to start racoon." + return 1 + fi + if [ ! -z ${RACOON_PSK_FILE} ] ; then + if [ ! -f ${RACOON_PSK_FILE} ] ; then + eerror "PSK file not found as specified." + eerror "Set RACOON_PSK_FILE in /etc/conf.d/racoon." + return 1 + fi + case "`ls -Lldn ${RACOON_PSK_FILE}`" in + -r--------*) + ;; + *) + eerror "Your defined PSK file should be mode 400 for security!" + return 1 + ;; + esac + fi +} + +command=/usr/sbin/racoon +command_args="-f ${RACOON_CONF} ${RACOON_OPTS}" +pidfile=/var/run/racoon.pid +start_stop_daemon_args="--wait ${RACOON_WAIT}" + +start_pre() { + checkconfig || return 1 + einfo "Loading ipsec policies from ${SETKEY_CONF}." + /usr/sbin/setkey ${SETKEY_OPTS} -f ${SETKEY_CONF} + if [ $? -eq 1 ] ; then + eerror "Error while loading ipsec policies" + fi +} + +stop_post() { + if [ -n "${RACOON_RESET_TABLES}" ]; then + ebegin "Flushing policy entries" + /usr/sbin/setkey -F + /usr/sbin/setkey -FP + eend $? + fi +} |