[Nut-upsuser] problem with a script via upssched-cmd

Sabine GOUDARD sabine.goudard at st-etienne.archi.fr
Thu Apr 18 10:42:22 UTC 2013


Hello
I'm running a script via upssched

on a onbatt event, I want to sent a email, shutdown a windows server and shutdown an ubuntu server
When I run my script manually, all is ok but via upssched-cmd
it return "exec_cmd returned 255"

here is the script
#!/bin/bash
# send mail to admin
echo "ECO" | mail -s "ARRET SERVEURS NON PRIORITAIRES" moi at domaine.fr 
net rpc shutdown -f -I ip_windows -U login%passwd
ssh login at ip_ubuntu sudo shutdown -h now

If I run only this cde
net rpc shutdown -f -I ip_windows -U login%passwd
it's ok

if I run only this cde
ssh login at ip_ubuntu sudo /sbin/shutdown -h now
I have returned 255

Is someone can help me
Thanks a lot



-- 


Sabine Goudard
Service Informatique et Multimédia
Tél : 04 77 42 37 20

Ecole Nationale Supérieure d’Architecture de Saint-Étienne
1, rue Buisson BP 94 
42003 Saint-Étienne Cedex 1
Fax : 04 77 42 35 40
[http://www.st-etienne.archi.fr -> http://www.st-etienne.archi.fr]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20130418/6c609ff1/attachment.html>


More information about the Nut-upsuser mailing list