/[gentoo-x86]/net-misc/tinc/files/tincd.1
Gentoo

Contents of /net-misc/tinc/files/tincd.1

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Thu Feb 2 20:29:33 2012 UTC (2 years, 6 months ago) by blueness
Branch: MAIN
Changes since 1.3: +2 -2 lines
Fix bug #401873

(Portage version: 2.1.10.44/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 # $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/files/tincd.1,v 1.3 2012/01/31 22:53:03 blueness Exp $
5
6 extra_started_commands="reload"
7
8 NETS="/etc/conf.d/tinc.networks"
9 DAEMON="/usr/sbin/tincd"
10
11 depend() {
12 use logger dns
13 need net
14 }
15
16 checkconfig() {
17 if ! grep -q '^ *NETWORK:' "${NETS}" ; then
18 eerror "No VPN networks configured in ${NETS}"
19 return 1
20 fi
21 }
22
23 start() {
24 checkconfig || return 1
25 ebegin "Starting tinc VPN networks"
26 awk '/^ *NETWORK:/ { print $2 }' "${NETS}" | while read NETNAME
27 do
28 CONFIG="/etc/tinc/${NETNAME}/tinc.conf"
29 PIDFILE="/var/run/tinc.${NETNAME}.pid"
30 if [ ! -f "${CONFIG}" ]; then
31 eerror "Cannot start network ${NETNAME}."
32 eerror "Please set up ${CONFIG} !"
33 else
34 ebegin "Starting tinc network ${NETNAME}"
35 if [ "${SYSLOG}" == "yes" ]; then
36 LOG=""
37 else
38 LOG="--logfile=/var/log/tinc.${NETNAME}.log"
39 fi
40 start-stop-daemon --start --exec "${DAEMON}" --pidfile "${PIDFILE}" -- --net="${NETNAME}" "${LOG}" --pidfile "${PIDFILE}"
41 eend $?
42 fi
43 done
44 }
45
46 stop() {
47 ebegin "Stopping tinc VPN networks"
48 awk '/^ *NETWORK:/ { print $2 }' "${NETS}" | while read NETNAME
49 do
50 PIDFILE="/var/run/tinc.${NETNAME}.pid"
51 if [ -f "${PIDFILE}" ]; then
52 ebegin "Stopping tinc network ${NETNAME}"
53 start-stop-daemon --stop --pidfile "${PIDFILE}"
54 eend $?
55 fi
56 done
57 }
58
59 reload() {
60 ebegin "Reloading configuration for tinc VPN networks"
61 awk '/^ *NETWORK:/ { print $2 }' "${NETS}" | while read NETNAME
62 do
63 PIDFILE="/var/run/tinc.${NETNAME}.pid"
64 if [ -f "${PIDFILE}" ]; then
65 ebegin "Reloading tinc network ${NETNAME}"
66 start-stop-daemon --signal HUP --pidfile ${PIDFILE}
67 eend $?
68 fi
69 done
70 }

  ViewVC Help
Powered by ViewVC 1.1.20