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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Sep 15 04:31:07 2013 UTC (13 months, 1 week ago) by tetromino
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Version bump, lots of bugs fixed. "systemctl enable NetworkManager" now properly enables NetworkManager-dispatcher (bug #477086). Drop old.

(Portage version: 2.2.4/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 && exec rc-service NetworkManager start ;;
21 down) nm-online -t 0 -x || exec rc-service NetworkManager stop ;;
22 pre-sleep) exec rc-service NetworkManager stop ;;
23 esac

  ViewVC Help
Powered by ViewVC 1.1.20