From patchwork Wed Jun 17 23:43:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1311686 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49nM8k6Qn8z9sRW; Thu, 18 Jun 2020 09:43:50 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jlhie-0001i6-6C; Wed, 17 Jun 2020 23:43:48 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jlhid-0001fp-1v for fwts-devel@lists.ubuntu.com; Wed, 17 Jun 2020 23:43:47 +0000 Received: from 2.general.alexhung.us.vpn ([10.172.65.255] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jlhic-00032U-Dl; Wed, 17 Jun 2020 23:43:46 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH] live-image: ask for sudo permissions instead of exiting Date: Wed, 17 Jun 2020 17:43:44 -0600 Message-Id: <20200617234344.392695-1-alex.hung@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Signed-off-by: Alex Hung --- live-image/fwts-frontend-text | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/live-image/fwts-frontend-text b/live-image/fwts-frontend-text index 7fe4533f..4c397438 100755 --- a/live-image/fwts-frontend-text +++ b/live-image/fwts-frontend-text @@ -31,7 +31,8 @@ FWTS_TIME=`date +%H%M` # if [ $EUID -ne 0 ]; then echo "`basename $0`: must be executed with sudo" - exit 1 + SELF="$(readlink -f "${BASH_SOURCE[0]}")" + exec sudo -- "$BASH" -- "$SELF" "$@" fi #