From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4986A138A1A for ; Fri, 9 Jan 2015 17:17:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F1B95E0852; Fri, 9 Jan 2015 17:17:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 24D96E085A for ; Fri, 9 Jan 2015 17:17:52 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 25138340728 for ; Fri, 9 Jan 2015 17:17:51 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C6A47F379 for ; Fri, 9 Jan 2015 17:17:49 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1420816093.ecba7604cf633342162deb802cb18008c55b0382.robbat2@OpenRC> Subject: [gentoo-commits] proj/netifrc:master commit in: init.d/ X-VCS-Repository: proj/netifrc X-VCS-Files: init.d/net.lo.in X-VCS-Directories: init.d/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: ecba7604cf633342162deb802cb18008c55b0382 X-VCS-Branch: master Date: Fri, 9 Jan 2015 17:17:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 5d614852-1246-4a89-b3e3-c86aea5ba0ea X-Archives-Hash: 4e32be073286e3d8c228328c168a2664 commit: ecba7604cf633342162deb802cb18008c55b0382 Author: Rabi Shanker Guha gmail com> AuthorDate: Fri Jan 9 15:08:13 2015 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Fri Jan 9 15:08:13 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/netifrc.git;a=commit;h=ecba7604 Update runscript to use functions.sh compatibility layer --- init.d/net.lo.in | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/init.d/net.lo.in b/init.d/net.lo.in index 6a0aefb..c79e7ff 100644 --- a/init.d/net.lo.in +++ b/init.d/net.lo.in @@ -2,6 +2,7 @@ # Copyright (c) 2007-2009 Roy Marples # Released under the 2-clause BSD license. +SHDIR="@LIBEXECDIR@/sh" MODULESDIR="@LIBEXECDIR@/net" MODULESLIST="${RC_SVCDIR}/nettree" _config_vars="config routes" @@ -13,9 +14,20 @@ description="Configures network interfaces." # Handy var so we don't have to embed new lines everywhere for array splitting __IFS=" " + +# Set the INIT to be openrc if this file is called directly +: ${INIT:=openrc} + +if [ -f "$SHDIR/functions.sh" ]; then + . "$SHDIR/functions.sh" +else + echo "$SHDIR/functions.sh missing. Exiting" + exit -1 +fi + depend() { - local IFACE=${RC_SVCNAME#*.} + local IFACE=$(get_interface) local IFVAR=$(shell_var "${IFACE}") need localmount @@ -526,7 +538,7 @@ interface_down() start() { - local IFACE=${RC_SVCNAME#*.} oneworked=false fallback=false module= + local IFACE=$(get_interface) oneworked=false fallback=false module= local IFVAR=$(shell_var "${IFACE}") cmd= our_metric= local metric=0 _up_before_preup eval _up_before_preup="\$up_before_preup_${IFVAR}" @@ -721,7 +733,7 @@ stop() # correctly if we go back to multiuser. yesno ${keep_network:-YES} && yesno $RC_GOINGDOWN && return 0 - local IFACE=${RC_SVCNAME#*.} module= + local IFACE=$(get_interface) module= local IFVAR=$(shell_var "${IFACE}") opts= einfo "Bringing down interface ${IFACE}"