/[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.1 - (show annotations) (download)
Thu Jul 5 02:33:10 2012 UTC (21 months, 1 week ago) by tetromino
Branch: MAIN
Fix the hang in 10-openrc-status that resulted in networkmanager getting marked as 'inactive' on resuming from suspend; many thanks to Travis Hansen for the solution (bugs #410661, #417283). Fix incompatibility with net-misc/dhcp[-ipv6] (bug #335147, thanks to Rick Harris). Move polkit rules.d file to /usr/share (bug #421577 comment #12, thanks to Dennis Lissov).

(Portage version: 2.2.0_alpha115/cvs/Linux x86_64)

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