<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Tahoma","sans-serif";
        color:#0037E6;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>I agree – using powerchute or another ups software clean shutdown is great…<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>My response was a scripted way to resolve the reboot issue based on what the writer asked for…<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Additionally “loop” wouldn’t happen… That’s why I wrote echo 1 >> some file and if check that file…<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] <b>On Behalf Of </b>Danny Nicholas<br><b>Sent:</b> Wednesday, July 27, 2011 10:14 AM<br><b>To:</b> 'Asterisk Users Mailing List - Non-Commercial Discussion'<br><b>Subject:</b> Re: [asterisk-users] Lightning and thunder<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>This is the “right” idea – have your UPS write “power loss shutdown” when it has to stop the machine, then check for that when you come back up and reboot when you see it (of course you would need to log something else to prevent a loop of reboots).<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] <b>On Behalf Of </b>Robert Huddleston<br><b>Sent:</b> Wednesday, July 27, 2011 9:05 AM<br><b>To:</b> 'Asterisk Users Mailing List - Non-Commercial Discussion'<br><b>Subject:</b> Re: [asterisk-users] Lightning and thunder<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>Maybe write a cludgy init.d script / bash… I.e. make a file somewhere called rebootflag… set it to 1 after you issue a shutdown –r –n now… then check it in init.d script…<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Pseudo code<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>In init.d / startup scripts<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>If /etc/manualreboot = 0 or file not found<o:p></o:p></span></p><p class=MsoNormal style='text-indent:.5in'><span style='color:#1F497D'>echo 1 >> /etc/manualreboot<o:p></o:p></span></p><p class=MsoNormal style='text-indent:.5in'><span style='color:#1F497D'>/sbin/shutdown –r –n now<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>end if<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] <b>On Behalf Of </b>Claude Hayn<br><b>Sent:</b> Wednesday, July 27, 2011 9:44 AM<br><b>To:</b> asterisk-users@lists.digium.com<br><b>Subject:</b> [asterisk-users] Lightning and thunder<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'>We are frequently losing power during lightning storms. (Yes we have UPS, but often by the time power comes back up the UPS has run out of juice)<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'>We are using Asterisk with a T1/PRI card as a front end connected to our PBX. Whenever there is a power outage both the Asterisk box and the PBX automatically reboot when power returns.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'>The Asterisk box automatically reconnects to the ITSP SIP Peer, and the PBX to the T1/PRI Card Asterisk box. <o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'>Incoming calls connect, but outbound calls will not complete until the Asterisk box is manually rebooted again.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'>Does anyone know of a solution for this issue? Having to get up in the late night to manually reboot the Asterisk box is getting old!<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'>Thank you,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'>Claude<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Tahoma","sans-serif";color:#0037E6'><o:p> </o:p></span></p></div></body></html>