Changeset 11805

Show
Ignore:
Timestamp:
03/14/11 12:20:53 (2 years ago)
Author:
p_lindheimer
Message:

change ownerships of web resources to AMPASTERISKWEBUSER not AMPASTERISKUSER, check for root before anything else

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.9/amp_conf/bin/freepbx_engine

    r11763 r11805  
    1212E_NOTROOT=67 # Non-root exit error 
    1313 
    14   # function to eventually get freepbx.conf to /etc  
    15 move_freepbxconf() {  
    16   if [ -e /etc/asterisk/freepbx.conf -a ! -e /etc/freepbx.conf ]; then  
    17     echo moving /etc/asterisk/freepbx.conf to /etc/freepbx.conf  
    18     mv /etc/asterisk/freepbx.conf /etc/  
    19     if [ "$?" -ne "0" ]; then  
     14echo 
     15# check to see if we are root 
     16if [ "$UID" -ne "$ROOT_UID" ] 
     17then 
     18  echo "Sorry, you must be root to run this script." 
     19  echo 
     20  exit $E_NOTROOT 
     21fi 
     22 
     23# function to eventually get freepbx.conf to /etc  
     24move_freepbxconf() { 
     25  if [ -e /etc/asterisk/freepbx.conf -a ! -e /etc/freepbx.conf ]; then 
     26    echo moving /etc/asterisk/freepbx.conf to /etc/freepbx.conf 
     27    mv /etc/asterisk/freepbx.conf /etc/ 
     28    if [ "$?" -ne "0" ]; then 
    2029      echo "unable to move, FreePBX will function fine but you will"  
    2130      echo "get this error until the file can be successfully moved"  
    22     else  
    23       FREEPBX_CONF="/etc/freepbx.conf"  
    24     fi  
    25   fi  
     31    else 
     32      FREEPBX_CONF="/etc/freepbx.conf" 
     33    fi 
     34  fi 
    2635} 
    2736 
     
    3645    FREEPBX_CONF="/etc/freepbx.conf" 
    3746  fi 
    38 fi 
    39  
    40 echo 
    41 # check to see if we are root 
    42 if [ "$UID" -ne "$ROOT_UID" ] 
    43 then 
    44   echo "Sorry, you must be root to run this script." 
    45   echo 
    46   exit $E_NOTROOT 
    4747fi 
    4848 
     
    156156  echo SETTING FILE PERMISSIONS 
    157157   
    158   chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP /etc/amportal.conf 
    159   chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP $FREEPBX_CONF 
     158  chown -R $AMPASTERISKWEBUSER:$AMPASTERISKWEBGROUP /etc/amportal.conf 
     159  chown -R $AMPASTERISKWEBUSER:$AMPASTERISKWEBGROUP $FREEPBX_CONF 
    160160  chmod g+w /etc/amportal.conf 
    161161  chmod g+w $FREEPBX_CONF 
     
    174174  chown -R $AMPASTERISKWEBUSER:$AMPASTERISKWEBGROUP $FOPWEBROOT 
    175175  chmod -R g+w $FOPWEBROOT 
    176   chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP $AMPWEBROOT/recordings 
     176  chown -R $AMPASTERISKWEBUSER:$AMPASTERISKWEBGROUP $AMPWEBROOT/recordings 
    177177  chmod -R g+w $AMPWEBROOT/recordings 
    178   chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP $AMPWEBROOT/_asterisk 
     178  chown -R $AMPASTERISKWEBUSER:$AAMPASTERISKWEBGROUP $AMPWEBROOT/_asterisk 
    179179  chmod u+x,g+x $ASTVARLIBDIR/bin/* 
    180180  chown -R $AMPASTERISKUSER:$AMPASTERISKGROUP $ASTVARLIBDIR/bin/*