[Nut-upsuser] Synology NAS is shutting down Ubuntu servers after very brief power outage (fwd)

Todd Benivegna todd at benivegna.com
Tue Aug 4 02:05:47 BST 2020


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?

--
Todd Benivegna // todd at benivegna.com
On Aug 3, 2020, 5:33 AM -0400, Roger Price <roger at rogerprice.org>, wrote:
> On Sun, 2 Aug 2020, Todd Benivegna wrote:
>
> > How would you write the SHUTDOWNCMD line with multiple commands?  I’ve been
> > looking at the manual and see that you have to escape the internal “ but am
> > still a little confused on how to do this exactly.
>
> This assumes that you use the Bash shell in your default environment. It will
> need adaption if you use Dash.
>
> In .bashrc define function getUPSstatus
>
> # Update variable UPSstatus and export to environment
> # Usage getUPSstatus <myups>
> function getUPSstatus {
> export UPSstatus="[$( upsc $1 ups.status 2>/dev/null )]:$( upsc $1 battery.charge 2>/dev/null )"
> }
>
> The SHUTDOWNCMD declaration now simplifies to
>
> SHUTDOWNCMD "getUPSstatus <myups> ; logger -t upsmon.conf \"UPS status is $UPSstatus\" ; /sbin/shutdown -h +0"
>
> Roger
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20200803/cb165065/attachment.html>


More information about the Nut-upsuser mailing list