/[gentoo-x86]/net-misc/networkmanager/files/10-openrc-status-r4
Gentoo

Contents of /net-misc/networkmanager/files/10-openrc-status-r4

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Jul 13 19:59:01 2013 UTC (15 months, 1 week ago) by pacho
Branch: MAIN
CVS Tags: HEAD
Inherit some changes from systemd-love to make it more systemd friendly

(Portage version: 2.1.12.13/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)

1 #!/bin/sh
2 # Copyright (c) 2012 Alexandre Rostovtsev
3 # Released under the 2-clause BSD license.
4
5 # Ensures that the NetworkManager OpenRC service is marked as started and
6 # providing net only when it has a successful connection.
7
8 if [ ! -e "/run/openrc/softlevel" ]; then
9 # OpenRC is not running
10 exit 0
11 fi
12
13 # Ensure rc-service is in PATH
14 PATH="${PATH}:@EPREFIX@/sbin:@EPREFIX@/usr/sbin"
15
16 # Exit if the NetworkManager OpenRC service is not running
17 rc-service NetworkManager status 2>&1 | grep -Eq "status: (starting|started|inactive|stopping)" || exit 0
18
19 # Call rc-service in background mode so that the start/stop functions update
20 # NetworkManager service status to started or inactive instead of actually
21 # starting or stopping the daemon
22 export IN_BACKGROUND=YES
23
24 case "$2" in
25 up) nm-online -t 0 -x &&
26 ! rc-service NetworkManager status 2>&1 | grep -q started &&
27 exec rc-service NetworkManager start ;;
28 down) nm-online -t 0 -x ||
29 rc-service NetworkManager status 2>&1 | grep -q stopped ||
30 exec rc-service NetworkManager stop ;;
31 pre-sleep) rc-service NetworkManager status 2>&1 | grep -q stopped ||
32 exec rc-service NetworkManager stop ;;
33 esac
34 exit 0
35 # vim: set ts=4:

  ViewVC Help
Powered by ViewVC 1.1.20