From patchwork Tue Aug 1 15:48:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 7053 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4RFfft5mDcz3wmm for ; Tue, 1 Aug 2023 15:49:10 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RFffn4nggz1DV; Tue, 1 Aug 2023 15:49:05 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RFffn4LDTz2yJG; Tue, 1 Aug 2023 15:49:05 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4RFffm6jBDz2xgB for ; Tue, 1 Aug 2023 15:49:04 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4RFffk2CGXz119; Tue, 1 Aug 2023 15:49:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1690904942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gA1aLqqLIycKzHDF9AcUmhMaEgIVu01jWPi/bQnhYTQ=; b=D/JNooElPWKRkj6QTXtYXzPnykECYbGGIwii05BMdoM/bWLyKNEo0WLxk9exU3knKHqoud T91Dwn2enOl7wRto0tq9WBGOtz/rajWQFAnegpCl0DrwDMzbmuz2QwoNYpS5nPnlY0pgoT +uXifeeRprPwhgei/16t2fhJlH6w165kheawZPfQ0/+bGugxPzQD9G3vMr1w1btnMTAWDb yyphu07dszfRNKf8R+r53OhYfuxF6tH4siDj5j7S5P4SlFufLw6XtiZdsi7bsIYJWTuEeM 2T51mhnIvNndO23liWB6mFt/mO3TSgdHvCcJb8VEvd2mX4WS7nIgN4xEPROqNA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1690904942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gA1aLqqLIycKzHDF9AcUmhMaEgIVu01jWPi/bQnhYTQ=; b=s/KRCjrvL+bUCbUrdyq1vRtYxSLFrY1/gAayfuHxTt1kK9SI9SdRna5EYz7aXU0Ue3lU1M xeBWfanvXFOXF3Dg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCHv2 06/12] extrahd.cgi: Display mount status next to the corresponding drive Date: Tue, 1 Aug 2023 17:48:33 +0200 Message-Id: <20230801154839.2373-6-stefan.schantl@ipfire.org> In-Reply-To: <20230801154839.2373-1-stefan.schantl@ipfire.org> References: <20230801154839.2373-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Stefan Schantl Reviewed-by: Bernhard Bitsch --- html/cgi-bin/extrahd.cgi | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index 4db540aae..bb84ef77c 100644 --- a/html/cgi-bin/extrahd.cgi +++ b/html/cgi-bin/extrahd.cgi @@ -302,14 +302,31 @@ END print < - + - END -; unless($disabled) { - print"\n"; +; + # Check if the mountpoint refers to a known configured drive. + if(&is_configured($mountpoint)) { + print "\n"; + print "\n"; + + # Check if the device is mounted properly. + if(&is_mounted($mountpoint)) { + print "MOUNTED \n"; + } else { + print "NOT MOUNTED \n"; + } + + print "\n"; + } else { + unless($disabled) { + print "\n"; + print "UNCONFIGURED \n"; + print "\n"; + } } print <