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 // [email protected] On Aug 3, 2020, 5:33 AM -0400, Roger Price <[email protected]>, 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 > [email protected] > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
_______________________________________________ Nut-upsuser mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
