root/freepbx/branches/2.3/apply_conf.sh

Revision 3994, 1.2 kB (checked in by p_lindheimer, 6 years ago)

revert r3925 - broke apply_conf.sh by puting /usr/sh - I aggree with the comments in the checking about 2 processes but this is called once at install time and doesn't matter - and please test before making checkins like this

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1 #!/usr/bin/env bash
2
3 if [ "$1" == "-h" ]
4 then
5   echo "Usage: "
6   echo "   "$0" [config]"
7   echo
8   echo "If config file is not specified, default is /etc/amportal.conf"
9   echo
10   exit
11 fi
12
13 if [ -n "$1" ]
14 then
15   AMPCONFIG=$1
16 else
17   AMPCONFIG=/etc/amportal.conf
18 fi
19
20 if [ ! -e $AMPCONFIG ]
21 then
22   echo "Cannot find $AMPCONFIG"
23   exit
24 fi
25
26 # include config file
27 echo "Reading $AMPCONFIG"
28 source $AMPCONFIG
29
30 echo "Updating configuration..."
31
32 echo "$ASTETCDIR/cdr_mysql.conf"
33 sed -i.bak "s/user=[a-zA-Z0-9]*/user=$AMPDBUSER/" $ASTETCDIR/cdr_mysql.conf
34 sed -i.bak "s/password=[a-zA-Z0-9]*/password=$AMPDBPASS/" $ASTETCDIR/cdr_mysql.conf
35 sed -i.bak "s/hostname=[a-zA-Z0-9.-]*/hostname=$AMPDBHOST/" $ASTETCDIR/cdr_mysql.conf
36
37 echo "$ASTETCDIR/manager.conf"
38 sed -i.bak "s/secret = [a-zA-Z0-9]*/secret = $AMPMGRPASS/" $ASTETCDIR/manager.conf
39 sed -i.bak "s/\[AMPMGRUSER\]/\[$AMPMGRUSER\]/" $ASTETCDIR/manager.conf
40
41 echo "$ASTETCDIR/vm_email.inc"
42 if [ "xx$AMPWEBADDRESS" = "xx" ]; then
43   echo "You might need to modify /etc/asterisk/vm_email.inc manually"
44 else
45   sed -i.bak "s!http://.*/recordings!http://$AMPWEBADDRESS/recordings!" $ASTETCDIR/vm_email.inc
46 fi
47
48
49 if [ -x /usr/sbin/amportal ]; then
50   echo "Adjusting File Permissions.."
51   /usr/sbin/amportal chown
52 fi
53
54 echo "Done"
Note: See TracBrowser for help on using the browser.