How to shutdown FreePBX remotely in case of power outage
Post ReplyHow to shutdown FreePBX remotely in case of power outagePosted: Monday, October 16, 2017 [15:13:20] - 1
If your FreePBX sits on the same power back-up UPS with your Mac, while Mac shutting down other "UPS unaware" computers this code can be added to shutdown script to turn-off your FreePBX as well. Shut-down script described here: https://www.codemacs.com/coding/shell/shutting-down-all-your-macs-on-power-outage.6740181.htm sleep(45); ## Wait for Asterisk to shutdown `ssh root@FREEPBX_IP 'shutdown -h now'`; as usual, you may want to include a full path to the appropriate commands as: The code above will gracefully stop asterisk and then shutdown a FreePBX box. Also, make sure your remote machine is set to auto-login to FreePBX, otherwise instead of processing command your script will get a password prompt and no command will be processed. |