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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Oct 26 22:57:57 2012 UTC (2 years, 2 months ago) by tetromino
Branch: MAIN
Version bump with various bugfixes. Update dispatcher script to correctly detect openrc service status at boot (bug #436044, thanks to cyberbat). Update license.

(Portage version: 2.2.0_alpha141/cvs/Linux x86_64, signed Manifest commit with key CF0ADD61)

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 # Ensure rc-service is in PATH
9 PATH="${PATH}:@EPREFIX@/sbin:@EPREFIX@/usr/sbin"
10
11 # Exit if the NetworkManager OpenRC service is not running
12 rc-service NetworkManager status 2>&1 | grep -Eq "status: (starting|started|inactive|stopping)" || exit 0
13
14 # Call rc-service in background mode so that the start/stop functions update
15 # NetworkManager service status to started or inactive instead of actually
16 # starting or stopping the daemon
17 export IN_BACKGROUND=YES
18
19 case "$2" in
20 up) nm-online -t 0 -x &&
21 ! rc-service NetworkManager status 2>&1 | grep -q started &&
22 exec rc-service NetworkManager start ;;
23 down) nm-online -t 0 -x ||
24 rc-service NetworkManager status 2>&1 | grep -q stopped ||
25 exec rc-service NetworkManager stop ;;
26 pre-sleep) rc-service NetworkManager status 2>&1 | grep -q stopped ||
27 exec rc-service NetworkManager stop ;;
28 esac
29 exit 0
30 # vim: set ts=4:

  ViewVC Help
Powered by ViewVC 1.1.20