Code Search for Developers
 
 
  

apply_conf.sh from freePBX at Krugle


Show apply_conf.sh syntax highlighted

#!/usr/bin/env bash

if [ "$1" == "-h" ]
then
	echo "Usage: "
	echo "   "$0" [config]"
	echo
	echo "If config file is not specified, default is /etc/amportal.conf"
	echo
	exit
fi

if [ -n "$1" ]
then
	AMPCONFIG=$1
else
	AMPCONFIG=/etc/amportal.conf
fi

if [ ! -e $AMPCONFIG ]
then
	echo "Cannot find $AMPCONFIG"
	exit
fi

# include config file
echo "Reading $AMPCONFIG"
source $AMPCONFIG

echo "Updating configuration..."

echo "$ASTETCDIR/cdr_mysql.conf"
sed -i.bak "s/user=[a-zA-Z0-9]*/user=$AMPDBUSER/" $ASTETCDIR/cdr_mysql.conf
sed -i.bak "s/password=[a-zA-Z0-9]*/password=$AMPDBPASS/" $ASTETCDIR/cdr_mysql.conf
sed -i.bak "s/hostname=[a-zA-Z0-9.-]*/hostname=$AMPDBHOST/" $ASTETCDIR/cdr_mysql.conf

echo "$ASTETCDIR/manager.conf"
sed -i.bak "s/secret = [a-zA-Z0-9]*/secret = $AMPMGRPASS/" $ASTETCDIR/manager.conf
sed -i.bak "s/\[AMPMGRUSER\]/\[$AMPMGRUSER\]/" $ASTETCDIR/manager.conf

echo "$ASTETCDIR/vm_email.inc"
if [ "xx$AMPWEBADDRESS" = "xx" ]; then
	echo "You might need to modify /etc/asterisk/vm_email.inc manually"
else
	sed -i.bak "s!http://.*/recordings!http://$AMPWEBADDRESS/recordings!" $ASTETCDIR/vm_email.inc
fi


if [ -x /usr/sbin/amportal ]; then 
	echo "Adjusting File Permissions.."
	/usr/sbin/amportal chown
fi

echo "Done"




See more files for this project here

freePBX

FreePBX is the most powerful GUI (Web Based) configuration tool for Asterisk. It provides everything that a standard legacy phone system can, plus a huge amount of new features. All documentation and information is avalable from http://www.freepbx.org

Project homepage: http://sourceforge.net/projects/amportal
Programming language(s): PHP,Shell Script,SQL
License: other

  SQL/
    cdr_mysql_table.sql
    newinstall.sql
    newinstall.sqlite3.sql
  amp_conf/
    agi-bin/
      phpagi-asmanager.php
      phpagi.php
    astetc/
      cdr_mysql.conf
      enum.conf
      extensions_custom.conf.sample
      features.conf
      indications.conf
      logger.conf
      manager.conf
      meetme.conf
      modem.conf
      modules.conf
      musiconhold.conf
      phone.conf
      phpagi.conf
      privacy.conf
      queues.conf
      rtp.conf
      vm_email.inc
      vm_general.inc
      voicemail.conf.template
      zapata.conf.template
    bin/
      archive_recordings
      bounce_op.sh
      freepbx-cron-scheduler.php
      freepbx_engine
      libfreepbx.confgen.php
      module_admin
      retrieve_conf
      retrieve_op_conf_from_mysql.pl
      retrieve_parse_amportal_conf.pl
    htdocs/
      _asterisk/
        animlogo.gif
        play.gif
        vmail.css
      admin/
        cdr/
          css/
          images/
          jpgraph_lib/
          lib/
          CHANGELOG.txt
          about.php
          call-comp.php
          call-daily-load.php
          call-last-month.php
          call-log.php
          cdr.php
          counter.txt
          encrypt.js
          export_csv.php
          export_pdf.php
          graph_hourdetail.php
          graph_pie.php
          graph_stat.php
          graph_statbar.php
          info.txt
        common/
          db_connect.php
          ie.css
          interface.dim.js
          jquery-1.1.3.1.js
          jquery.dimensions.js
          jquery.tabs-2.7.4.js
          json.inc.php
          libfreepbx.javascripts.js
          mainstyle-alternative.css
          mainstyle.css
          php-asmanager.php
          script.js.php
          script.legacy.js
          tabber-minimized.js
        i18n/
          de_DE/
          es_ES/
          fr_FR/
          he_IL/
          it_IT/
          pt_PT/
          ru_RU/
          readme.txt
        images/
          accept.png
          amp.png
          arrow_rotate_clockwise.png
          blank.gif
          cancel.png
          category1.png
          database_gear.png
          delete.gif
          freepbx.png
          freepbx_large.png
          freepbx_small.png
          header-back.png
          loading.gif
          logo.png
          modules-current1.png
          modules-hover1.png
          modules1.png
          scrolldown.gif
          scrollup.gif
          shadow-corner.png
          shadow-side-background.png
          shadow-side.png
          shadow-top.png
          tab-first-current.png
          tab-first.png
          tab-hover.png
          tab-select.png
          tab.png
          trash.png
          watermark.png
        modules/
          _cache/
          .htaccess
          import.sh
          modlist.sh
          remove.sh
          status.sh
          update.sh
        views/
          freepbx.php
          freepbx_admin.php
          freepbx_reload.php
          freepbx_reloadbar.php
          loggedout.php
          menuitem_disabled.php
          noaccess.php
          panel.php
          reports.php
          unauthorized.php
          welcome.php
          welcome_nomanager.php
        components.class.php
        config.php
        extensions.class.php
        favicon.ico
        featurecodes.class.php
        functions.inc.php
        header.php
        header_auth.php
        index.php
        page.modules.php
        panel.php
        reports.php
      recordings/
        includes/
        locale/
        misc/
      index.html
      mainstyle.css
    htdocs_panel/
    mohmp3/
    sbin/
    sounds/
  buildtools/
  docs/
  upgrades/
  CHANGES
  CONTRIB.txt
  ChangeLog
  FAQ
  INSTALL
  LICENSE
  UPGRADE
  amportal.conf
  apply_conf.sh
  asterisk.conf
  freepbx.pot
  install_amp
  libfreepbx.install.php
  setup_svn.php
  sqlite.readme
  start_asterisk
  update_l10n.sh