public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in net-misc/networkmanager/files: 10-openrc-status-r4
@ 2013-07-13 19:59 Pacho Ramos (pacho)
  0 siblings, 0 replies; only message in thread
From: Pacho Ramos (pacho) @ 2013-07-13 19:59 UTC (permalink / raw
  To: gentoo-commits

pacho       13/07/13 19:59:01

  Added:                10-openrc-status-r4
  Log:
  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)

Revision  Changes    Path
1.1                  net-misc/networkmanager/files/10-openrc-status-r4

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/networkmanager/files/10-openrc-status-r4?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/networkmanager/files/10-openrc-status-r4?rev=1.1&content-type=text/plain

Index: 10-openrc-status-r4
===================================================================
#!/bin/sh
# Copyright (c) 2012 Alexandre Rostovtsev
# Released under the 2-clause BSD license.

# Ensures that the NetworkManager OpenRC service is marked as started and
# providing net only when it has a successful connection.

if [ ! -e "/run/openrc/softlevel" ]; then
	# OpenRC is not running
	exit 0
fi

# Ensure rc-service is in PATH
PATH="${PATH}:@EPREFIX@/sbin:@EPREFIX@/usr/sbin"

# Exit if the NetworkManager OpenRC service is not running
rc-service NetworkManager status 2>&1 | grep -Eq "status: (starting|started|inactive|stopping)" || exit 0

# Call rc-service in background mode so that the start/stop functions update
# NetworkManager service status to started or inactive instead of actually
# starting or stopping the daemon
export IN_BACKGROUND=YES

case "$2" in
	up) nm-online -t 0 -x &&
		! rc-service NetworkManager status 2>&1 | grep -q started &&
		exec rc-service NetworkManager start ;;
	down) nm-online -t 0 -x ||
		rc-service NetworkManager status 2>&1 | grep -q stopped ||
		exec rc-service NetworkManager stop ;;
	pre-sleep) rc-service NetworkManager status 2>&1 | grep -q stopped ||
		exec rc-service NetworkManager stop ;;
esac
exit 0
# vim: set ts=4:





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-13 19:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-13 19:59 [gentoo-commits] gentoo-x86 commit in net-misc/networkmanager/files: 10-openrc-status-r4 Pacho Ramos (pacho)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox