<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">Thank you!  Sorry for another bonehead question…. Do I replace <myups> with the IP address of the NUT Server/Synology?  I’m assuming I would use this version for use in Dash with Ubuntu, correct?</div>
</div>
<div name="messageSignatureSection"><br />
<p style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue"; color: rgb(34, 34, 34);">--</p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue"; color: rgb(51, 51, 51);"><span style="color: #222222"><b>Todd Benivegna</b></span> <span style="color: #222222">//</span> <a href="mailto:todd@benivegna.com">todd@benivegna.com</a></p>
</div>
<div name="messageReplySection">On Aug 3, 2020, 5:33 AM -0400, Roger Price <roger@rogerprice.org>, wrote:<br />
<blockquote type="cite" style="border-left-color: grey; border-left-width: thin; border-left-style: solid; margin: 5px 5px;padding-left: 10px;">On Sun, 2 Aug 2020, Todd Benivegna wrote:<br />
<br />
<blockquote type="cite">How would you write the SHUTDOWNCMD line with multiple commands?  I’ve been<br />
looking at the manual and see that you have to escape the internal “ but am<br />
still a little confused on how to do this exactly.<br /></blockquote>
<br />
This assumes that you use the Bash shell in your default environment. It will<br />
need adaption if you use Dash.<br />
<br />
In .bashrc define function getUPSstatus<br />
<br />
# Update variable UPSstatus and export to environment<br />
# Usage getUPSstatus <myups><br />
function getUPSstatus {<br />
export UPSstatus="[$( upsc $1 ups.status 2>/dev/null )]:$( upsc $1 battery.charge 2>/dev/null )"<br />
}<br />
<br />
The SHUTDOWNCMD declaration now simplifies to<br />
<br />
SHUTDOWNCMD "getUPSstatus <myups> ; logger -t upsmon.conf \"UPS status is $UPSstatus\" ; /sbin/shutdown -h +0"<br />
<br />
Roger<br />
_______________________________________________<br />
Nut-upsuser mailing list<br />
Nut-upsuser@alioth-lists.debian.net<br />
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</blockquote>
</div>
</body>
</html>