Forums

Leon
Leon
Offline
Resolved
0 votes
Hi all

I would like to know if it is possible to send a "Shutdown" command from a RPI to my ClearOS.
I run domoticz on the RPI and i can monitor the UPS load and battery status to shutdown at a predetermined value.
I would prefer to NOT connect the UPS to ClearOS as i have a few things connected to it.
Thursday, October 17 2019, 06:35 PM
Share this post:
Responses (3)
  • Accepted Answer

    Wednesday, October 23 2019, 10:22 AM - #Permalink
    Resolved
    0 votes
    Leon,
    While I think the propsal from Nick might be the easiest to implement as a domoticz triggered script on the RPI, I just want to say (Slightly off-topic maybe): Do you know that you can run Domoticz on ClearOS too, either as a replacement for the RPI (if you are not using RPI specific stuff etc) or as a complement running both of them in a master-slave config? I am maintaining a package in the clearos-contribs repo. There is also an app in the clearos market place if you prefer an easy setup.

    I have however not tried to run master-slave configurations, so I can not give you any advice on it.

    /Fred
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, October 19 2019, 02:56 PM - #Permalink
    Resolved
    0 votes
    ssh root@clearos_IP 'shutdown -h -t 5 +0 & exit'
    Seemed to work pretty instantaneously and closed my ssh session gracefully.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, October 17 2019, 07:36 PM - #Permalink
    Resolved
    0 votes
    I don't see why you can't. Set up ssh keys - private on the Pi and public on ClearOS - then from the Pi send the command:
    ssh root@clearos_IP 'poweroff'
    It is a bit brutal as if forcibly closes the ssh session rather than politely. You could instead try something like:
    ssh root@clearos_IP 'shutdown -h +1 & exit'
    This gives a 1 minute delay from issuing the command. I am not sure how to get the delay smaller as the increment is in minutes. +0 is equivalent to the "poweroff" command.
    The reply is currently minimized Show
Your Reply