echo 
echo "*** Install pbxportal script ***"
echo

cp -f pbxportal /usr/sbin/pbxportal

chmod 755 /usr/sbin/pbxportal
chmod +x  /usr/sbin/pbxportal
ln -s /usr/sbin/pbxportal /etc/init.d/pbxportal
touch /var/lock/subsys/pbxportal
chkconfig --add pbxportal


cat > /etc/pbxportal.conf <<-EOF
# This file contains settings for components of the Asterisk Management Portal
# Spaces are not allowed!

ASTETCDIR=/etc/asterisk
ASTMODDIR=/usr/lib/asterisk/modules
ASTVARLIBDIR=/var/lib/asterisk
ASTAGIDIR=/var/lib/asterisk/agi-bin
ASTSPOOLDIR=/var/spool/asterisk
ASTRUNDIR=/var/run/asterisk
ASTLOGDIR=/var/log/asterisk
ASTRUNUSER=asterisk
ASTRUNGROUP=asterisk
EOF

#/etc/init.d/pbxportal start

