From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9EA71139695 for ; Mon, 12 Jun 2017 23:01:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5001321C04E; Mon, 12 Jun 2017 23:01:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 300ED21C04E for ; Mon, 12 Jun 2017 23:01:50 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 06E9F3419E7 for ; Mon, 12 Jun 2017 23:01:49 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 347C3747C for ; Mon, 12 Jun 2017 23:01:47 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1497288258.dcc686e42b406d63d52ef75de9a326f67d0a06c9.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: scripts/ X-VCS-Repository: proj/openrc X-VCS-Files: scripts/shutdown.in X-VCS-Directories: scripts/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: dcc686e42b406d63d52ef75de9a326f67d0a06c9 X-VCS-Branch: master Date: Mon, 12 Jun 2017 23:01:47 +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: d1e5d5b2-ba44-43f7-9283-d5fca6680c00 X-Archives-Hash: 5eca5a38fba3acb549a695fb9b83eaf9 commit: dcc686e42b406d63d52ef75de9a326f67d0a06c9 Author: William Hubbs gmail com> AuthorDate: Mon Jun 12 17:24:18 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Mon Jun 12 17:24:18 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=dcc686e4 scripts/shutdown: fix arguments to be sysvinit shutdown compatible This fixes #140. scripts/shutdown.in | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/shutdown.in b/scripts/shutdown.in index 4f6ba637..4a3d9fd1 100644 --- a/scripts/shutdown.in +++ b/scripts/shutdown.in @@ -1,8 +1,17 @@ #!@SHELL@ -args="$@" -case "$@" in - *--single*|*-s*) args="$@" ;; - *) args="--single $@";; +args= +for x; do + case "$x" in + -h) args=" ${args} --halt" ;; + *) args=" ${args} ${x} " ;; + esac +done + +case "$args" in + *-h|--halt*) ;; + *-s|--single*) ;; + *) args=" --single ${args}" ;; esac + exec @SBINDIR@/openrc-shutdown "$args"