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 853A4139694 for ; Tue, 11 Jul 2017 17:06:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CDB8D214108; Tue, 11 Jul 2017 17:06:47 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 A9C2E214108 for ; Tue, 11 Jul 2017 17:06:47 +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 8466A34181E for ; Tue, 11 Jul 2017 17:06:46 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E60957497 for ; Tue, 11 Jul 2017 17:06:44 +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: <1499792003.03a461ac0ee34b7900868cdea624c6fd868b1656.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: scripts/ X-VCS-Repository: proj/openrc X-VCS-Files: scripts/reboot.in X-VCS-Directories: scripts/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 03a461ac0ee34b7900868cdea624c6fd868b1656 X-VCS-Branch: master Date: Tue, 11 Jul 2017 17:06:44 +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: 0e2279e6-b7ff-41e9-ac04-88f1ae12751c X-Archives-Hash: aa7cc4b376062f2373be164787761e90 commit: 03a461ac0ee34b7900868cdea624c6fd868b1656 Author: William Hubbs gmail com> AuthorDate: Tue Jul 11 16:53:23 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Tue Jul 11 16:53:23 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=03a461ac fix sysvinit compatibility for reboot wrapper scripts/reboot.in | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/reboot.in b/scripts/reboot.in index 4da78bb7..c805ceb2 100644 --- a/scripts/reboot.in +++ b/scripts/reboot.in @@ -1,3 +1,25 @@ #!@SHELL@ -exec @SBINDIR@/openrc-shutdown --reboot "$@" +option_arg= +poweroff_arg= +while getopts :nwdfhik opt; do + case "$opt" in + n) ;; + w) poweroff_arg=--write-only ;; + d) option_arg=--no-write ;; + f) ;; + h) ;; + i) ;; + k) poweroff_arg=--kexec ;; + [?]) printf "%s\n" "${0##*/}: invalid command line option" >&2 + exit 1 + ;; + esac +done +shift $((OPTIND-1)) + +if [ -z "${poweroff_arg}" ]; then + poweroff_arg=--reboot +fi + +exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "$@"