Apcupsd run script?

I want apcupsd to run a sript on the master computer in case the power is missing for my ups i have according to the guide from apcupsd added it in this folder:

/Etc/apcupsd

And called it: "doshutdown"

And chmod + x

It looks like this:

#!/bin/bash
ssh 192.168.1.183 sudo shutdown -P 0
ssh 192.168.1.189 sudo shutdown -P 0
exit 99

I have created a ssh private key and added the following to the computer to be shut down:

sudo visudo
yourusername ALL = NOPASSWD: /sbin/shutdown

I can run the command from the terminal and shut down the machine on my network but apcupsd will not run my script any bid on why?

5 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like