Changeset 11006 for freepbx/trunk/apply_conf.sh
- Timestamp:
- 01/17/11 20:46:44 (1 year ago)
- Files:
-
- freepbx/trunk/apply_conf.sh (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk/apply_conf.sh
r5122 r11006 1 1 #!/bin/bash 2 3 if [ -z "$FREEPBX_CONF" ]; then 4 if [ -e "/etc/freepbx.conf" ]; then 5 FREEPBX_CONF="/etc/freepbx.conf" 6 elif [ -e "/etc/asterisk/freepbx.conf" ]; then 7 FREEPBX_CONF="/etc/asterisk/freepbx.conf" 8 else 9 FREEPBX_CONF="/etc/freepbx.conf" 10 fi 11 fi 2 12 3 13 if [ "$1" == "-h" ] … … 6 16 echo " "$0" [config]" 7 17 echo 8 echo "If config file is not specified, default is /etc/amportal.conf" 18 echo "If config file is not specified, FreePBX must be installed and" 19 echo "the script will bootstrap the information" 9 20 echo 10 21 exit … … 14 25 then 15 26 AMPCONFIG=$1 27 if [ ! -e $AMPCONFIG ] 28 then 29 echo "Cannot find $AMPCONFIG" 30 exit 31 fi 32 # include config file 33 echo "Reading $AMPCONFIG" 16 34 else 17 AMPCONFIG=/etc/amportal.conf35 echo "Bootstrapping Configuration Settings" 18 36 fi 19 37 20 if [ ! -e $AMPCONFIG ] 21 then 22 echo "Cannot find $AMPCONFIG" 23 exit 38 # get settings from db/config file 39 if [ -n "$AMPCONFIG" ]; then # If told to parse out of file, go for it 40 . $AMPCONFIG 41 elif [[ -e $FREEPBX_CONF ]]; then 42 43 # get the path of this file to call the gen_amp_conf.php script which will 44 # generate all the amp_conf variables that can be exported 45 # 46 progdir=`dirname $0` 47 sv_pwd=$PWD 48 cd $progdir 49 gen_path=$PWD 50 cd $sv_pwd 51 `$gen_path/amp_conf/bin/gen_amp_conf.php` 52 else 53 echo; 54 echo "FreePBX config file not found!"; 55 echo "specificy amportal.conf as argument if FreePBX is not yet installed"; 56 exit; 24 57 fi 25 26 # include config file27 echo "Reading $AMPCONFIG"28 source $AMPCONFIG29 58 30 59 echo "Updating configuration..." … … 47 76 48 77 49 if [ -x /usr/sbin/amportal ]; then78 if [ -x $AMPSBIN/amportal ]; then 50 79 echo "Adjusting File Permissions.." 51 /usr/sbin/amportal chown80 $AMPSBIN/amportal chown 52 81 fi 53 82
