Gentoo Archives: gentoo-commits

From: "Lars Wendler (polynomial-c)" <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/netplug/files: netplug.2
Date: Mon, 03 Oct 2011 07:09:33
Message-Id: 20111003070924.4C7F22004C@flycatcher.gentoo.org
1 polynomial-c 11/10/03 07:09:24
2
3 Added: netplug.2
4 Log:
5 New maintainer. Version bump. New startup script
6
7 (Portage version: 2.2.0_alpha60/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 sys-apps/netplug/files/netplug.2
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/netplug/files/netplug.2?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/netplug/files/netplug.2?rev=1.1&content-type=text/plain
14
15 Index: netplug.2
16 ===================================================================
17 #!/bin/sh
18 # Copyright 1999-2011 Gentoo Foundation
19 # Distributed under the terms of the GNU General Public License v2
20 #
21 # Gentoo-specific netplug script
22 #
23 # This file gets called by netplug when it wants to bring an interface
24 # up or down.
25 #
26
27 IFACE="$1"
28 ACTION="$2"
29
30 EXEC="/etc/init.d/net.${IFACE}"
31
32 case "${ACTION}" in
33 in)
34 ARGS="--quiet start"
35 ;;
36 out)
37 ARGS="--quiet stop"
38 ;;
39 probe)
40 # Do nothing as we should already be up
41 exit 0
42 ;;
43 *)
44 echo "$0: wrong arguments" >&2
45 echo "Call with <interface> <in|out|probe>" >&2
46 exit 1
47 ;;
48 esac
49
50 export IN_BACKGROUND=true
51
52 if [ -x "${EXEC}" ]
53 then
54 ${EXEC} ${ARGS}
55 exit 0
56 else
57 logger -t netplug "Error: Couldn't configure ${IFACE}, no ${EXEC} !"
58 exit 1
59 fi