#!/bin/sh
amportal stop
shutdown -h now
/usr/sbin/pbx-stop
chmod 744 /usr/sbin/pbx-stop
Un-used Modules > Scheduled Cron Jobs
Create a new scheduled cron job
root
/usr/sbin/pbx-stop
Times and dates selected below ..
Save
You could better try the existing safe scripts for 'halt' and 'reboot' to be found in /usr/local/sbin/after you sent me this i started to google more info about it and i came a cross https://www.ukvoipforums.com/viewtopic.php?t=567 which i think is also on this site somewhere.
cat /usr/local/sbin/halt
cat /usr/local/sbin/reboot
[macro-shutdown]
exten => s,1,Authenticate(1234)
exten => s,1,NoOp(Looks like we're going to shutdown!)
exten => s,n,System(/usr/bin/sudo /usr/local/sbin/halt )
[macro-reboot]
exten => s,1,Authenticate(1234)
exten => s,1,NoOp(Looks like we're going to reboot!)
exten => s,n,System(/usr/bin/sudo /usr/local/sbin/reboot )
Problem was that in some flavors of Debian/Ubuntu, halt just halted... in a split second. It was fairly obvious that it wasn't shutting anything down gracefully. In the case of MySQL and Asterisk, that was obviously asking for trouble. And that's the reason we implemented the separate halt and reboot scripts in /usr/local/sbin.
Link up your team and customers Phone System Live Chat Video Conferencing
Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.
Check your inbox!
We’ve sent you an email. Click on the button in the email body to verify your email address – (if you can not find it, check your spam folder).
Upon verification you will be directed to the 3CX setup wizard.