required are:
+
-------------------------------------------------------------------
-cgi.assign = ( ".sh" => "/bin/sh",".pl" => "/usr/sbin/microperl" )
+cgi.assign = ( ".sh" => "/bin/sh",".pl" => "/usr/bin/perl" )
-------------------------------------------------------------------
[[contribute]]
<table align="right" width=600>
<tr><td align="left" valign="top"><h2>About</h2></td></tr>
EOF
-echo ' <tr><td><a href="http://rowetel.com/ucasterisk/mini.html">Mini Asterisk</a> Revision: 122 </td></tr> '
+echo ' <tr><td><a href="http://rowetel.com/ucasterisk/mini.html">Mini Asterisk</a> Revision: 132 </td></tr> '
echo ' <tr><td> </td></tr>'
echo ' <tr><td>Brought to you by the <a href="http://rowetel.com/ucasterisk/index.html">Free Telephony Project</a></td></tr>'
echo ' <tr><td><a href="http://rowetel.com/ucasterisk/ip04.html"><img src="http://rowetel.com/images/ip04/ip04_case.jpg" border="0" /></a></td></tr>'
asterisk -rx "dialplan reload" 2>/dev/null 1 > /dev/null
fi
+# Upgrade Mini Asterisk CGI ----------------------------------------------------
+
+echo "$QUERY_STRING" | grep -oe "upgrade=1" > /dev/null
+if [ $? -eq 0 ]; then
+ cat <<EOF
+ <html>
+ <head>
+ <title>Mini Asterisk - Upgrade</title>
+ </head>
+ <body>
+ <h2>Upgrading...</h2>
+EOF
+ rev_before=`grep -oe "Revision: [0-9]*" /www/about.sh`
+ echo "<strong>Current $rev_before</strong><br>"
+ echo "<strong>Removing $ver_before</strong><br>"
+ ipkg remove mini-asterisk-gui | tr '\n' '#' | sed -n 's/\#/<br>/pg'
+ echo "<strong>Installing...</strong><br>"
+ ipkg update | tr '\n' '#' | sed -n 's/\#/<br>/pg'
+ ipkg install mini-asterisk-gui | tr '\n' '#' | sed -n 's/\#/<br>/pg'
+
+ # Note - never actually gets here as admin.sh is wiped out by upgrade..
+ # need a better way of handling this....
+
+ rev_after=`grep -oe "Revision: [0-9]*" /www/about.sh`
+ echo "<strong>$rev_after installed</strong>"
+ echo "</body></html>"
+ exit
+fi
+
# Construct the web page -------------------------------
cat <<EOF
<form action="admin.sh" method="get">
<input type="hidden" name="upgrade" value="1">
<input type="submit" value="Upgrade">
+ </form>
</td>
</tr>
# use perl to construct list of IP phones for us
asterisk "-rx sip show peers" 2>/dev/null > sipshowpeers.txt
- ./ipphones.pl $ipaddress $more
+ perl ipphones.pl $ipaddress $more
cat <<EOF
</table>
# use perl to construct list of phones and phone lines for us
asterisk "-rx sip show peers" 2>/dev/null > sipshowpeers.txt
-./phones.pl
+perl ./phones.pl
cat<<EOF
</table>
# create new sip.conf with selected provider uncommented
echo "set_voiplines.sh" $user $pass $host $stanza >> /tmp/log.txt
-./set_voiplines.pl $user $pass $host $stanza > /etc/asterisk/sip.conf.new
+perl set_voiplines.pl $user $pass $host $stanza > /etc/asterisk/sip.conf.new
mv /etc/asterisk/sip.conf /etc/asterisk/sip.conf.bak
mv /etc/asterisk/sip.conf.new /etc/asterisk/sip.conf
off and back on. </div>
<div id="admin_upgrade" class="tip">
- Press this button to the latest version of
- Mini Asterisk. An Mini Asterisk upgrade
- requires an Internet connection.</div>
+ Press this button to install the latest
+ version of Mini Asterisk. An Mini Asterisk
+ upgrade requires an Internet connection.</div>
<div id="admin_firmware" class="tip">
Enter the URL of a firmware update script.
<tr><td> </td></tr>
EOF
-./voiplines.pl
+perl ./voiplines.pl
cat <<EOF
<tr><td> </td></tr>