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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1C70315852A for ; Mon, 19 Aug 2024 00:27:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B04452BC024; Mon, 19 Aug 2024 00:27:21 +0000 (UTC) Received: from out.packetderm.com (out.packetderm.com [173.166.91.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 474CB2BC01A for ; Mon, 19 Aug 2024 00:27:20 +0000 (UTC) Received: from localhost (out.packetderm.com[173.166.91.13]) by smtp (5.7.4/5.7.4) with ESMTPSA id 47J0RIuX068431 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 18 Aug 2024 20:27:19 -0400 (EDT) (envelope-from waltdnes@waltdnes.org) Date: Sun, 18 Aug 2024 20:27:25 -0400 From: Walter Dnes To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Suggestions for Gentoo-compatable UPS; stores around Toronto?? Message-ID: References: <84993af5-6bd9-f91c-60e2-78f60e91cc18@gmail.com> <0a59e8d9-2cf8-78a2-860e-cc398546652b@gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0a59e8d9-2cf8-78a2-860e-cc398546652b@gmail.com> X-Archives-Salt: 84b11982-110a-4293-8bda-d6538c499e89 X-Archives-Hash: 67c2f32d9f7c2b61a7901be259249900 On Sun, Aug 18, 2024 at 04:06:41PM -0500, Dale wrote > > I think I get what your script does.  When Nut sees onbatt then it > executes your script because of the NOTIFYCMD option.  The script then > waits 60 seconds then executes what is under 'done'. > Could one change the 60 seconds to say 300 seconds? At the top of the script is the line "counter=60". Change that to "counter=300". The script does a "sleep 1" (1 second delay) each pass through the "while" loop. Note that it also checks... if echo "$output" | grep -q "OB" ...on each pass through the loop. ***IF AC POWER IS RESTORED BEFORE THE COUNTDOWN FINISHES*** the battery is no longer in use and the "if" returns false. It then executes the "else" portion of the loop on that pass and exits the script without taking any action. I don't want to hibernate or shutdown for a short 5-second power blip. -- There are 2 types of people 1) Those who can extrapolate from incomplete data