Ok, so now that I think of it, that might not actually work when it is not run by me. I guess that it all confirms that it works in Bash, but I think when it runs on its own it would use Dash...
The default login shell remains bash. Opening a terminal from the menu or > shortcut [crtl-alt-t] provides interactive bash. A script run from the > desktop or file manager, through the dialogue 'run in terminal' will > execute as POSIX dash. https://wiki.ubuntu.com/DashAsBinSh So I would need to put the function in .profile then, right? Could I leave it in both .bashrc and .profile so it'd work either way? On Tue, Aug 4, 2020 at 8:39 AM Todd Benivegna <[email protected]> wrote: > Ok, gotcha, I did that. I believe Ubuntu uses Bash for user sessions and > Dash fornscripts, so followed your instructions for Dash. I put the > getUPStatus bits in .bashrc and tested in Terminal and got: > > UPS status is [OL]:100 > > So I went ahead and put your SHUTDOWNCMD in upsmon.conf. I think it should > be working now.... > > -- > > *Todd Benivegna* // [email protected] > On Aug 4, 2020, 3:13 AM -0400, Roger Price <[email protected]>, wrote: > > On Mon, 3 Aug 2020, Todd Benivegna wrote: > > 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? > > > Yes, you replace <myups> with the address of your UPS, for example > "[email protected]". Are you using Dash or Bash? If it's Dash, the function > getUPSstatus probably goes into .profile . > > Test on the command line before modifying SHUTDOWNCMD by typing the > commands > > getUPSstatus <myups> > echo "UPS status is $UPSstatus" > > You should see "UPS status is [OL]:100". > > Roger > _______________________________________________ > Nut-upsuser mailing list > [email protected] > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser > > -- *Todd Benivegna* // [email protected]
_______________________________________________ Nut-upsuser mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
