#!/bin/sh
html_header()
{
echo '
'
echo ''
echo "$1"
echo ''
echo "";
echo ''
echo ''
}
html_footer()
{
echo '
'
}
main()
{
html_header "AMI Commands"
echo "Команда | Описание |
"
asterisk -rx "manager show commands"|tail -n +3|while read cmd desc
do
echo "$cmd | $desc |
"
asterisk -rx "manager show command $cmd"|ansi2html --style 'pre {font-family: Consolas}'>"$cmd.html"
done
html_footer
}
#========= Main =========
if [ "x$1" = "xclean" ]
then
rm -f *.html
else
main 1>index.html
fi