head	1.3;
access;
symbols
	HORDE_1_2_4:1.1.2.6
	HORDE_1_2_3:1.1.2.6
	HORDE_1_2_2:1.1.2.5
	HORDE_1_2_1:1.1.2.3
	HORDE_1_2_0:1.1.2.3
	HORDE_1_2_0_pre14:1.1.2.5
	HORDE_1_2_0_pre13:1.1.2.2
	HORDE_1_2_0_pre11:1.1.2.2
	HORDE_1_2_0_pre10:1.1.2.1
	HORDE_1_2_0_pre9:1.1.2.1
	HORDE_1_2_0_pre8:1.1.2.1
	HORDE_1_2_0_pre6:1.1.2.1
	STABLE_1_2:1.1.0.2;
locks; strict;
comment	@# @;


1.3
date	2000.05.22.11.13.13;	author rkrusty;	state dead;
branches;
next	1.2;

1.2
date	2000.02.15.07.48.38;	author rkrusty;	state Exp;
branches;
next	1.1;

1.1
date	99.12.05.06.44.48;	author rkrusty;	state dead;
branches
	1.1.2.1;
next	;

1.1.2.1
date	99.12.05.06.44.48;	author rkrusty;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2000.02.04.21.55.05;	author rkrusty;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2000.06.29.07.58.24;	author rkrusty;	state Exp;
branches;
next	1.1.2.4;

1.1.2.4
date	2000.09.11.06.14.44;	author rkrusty;	state Exp;
branches;
next	1.1.2.5;

1.1.2.5
date	2000.09.11.06.15.39;	author rkrusty;	state Exp;
branches;
next	1.1.2.6;

1.1.2.6
date	2000.09.21.09.47.13;	author rkrusty;	state Exp;
branches;
next	1.1.2.7;

1.1.2.7
date	2001.02.06.19.58.37;	author opal;	state Exp;
branches;
next	1.1.2.8;

1.1.2.8
date	2001.02.07.09.23.51;	author opal;	state Exp;
branches;
next	1.1.2.9;

1.1.2.9
date	2001.02.26.20.12.59;	author opal;	state dead;
branches;
next	;


desc
@@


1.3
log
@[IEM] cleaning out the debian dir to prepare for the new stuff...nice clean
start. :)
@
text
@#!/bin/sh -e
# update-horde
#
# written by Ivan E. Moore II <rkrusty@@tdyc.com> with help from
# debconf examples and tons of other references
#
# Source debconf library
. /usr/share/debconf/confmodule
db_version 2.0

case "$1" in
    debconf)
	 db_set "horde/debconf" "yes"
         echo "Setting configuration method to: debconf"
         exit 0
    ;;
esac
echo ""
echo "Setting configuration method to: Manual"
echo ""
echo "To change back to the debconf method run: update-horde debconf"
echo ""
db_set "horde/debian" "no"

# Where the config file is that stores the previous selections
HORDE_FILE="/etc/horde/horde.php";
TEMPLATE_FILE="/etc/horde/horde.php.in";

# Read in template
. "$TEMPLATE_FILE"

# Create a new temp file
TMPFILE=`mktemp /tmp/horde.XXXXXX` || exit 1

# Now let's create the horde.php file needed by HORDE
echo "Creating new horde.php file"
echo "<?php" >>$TMPFILE
echo "" >>$TMPFILE
echo "/*            DO NOT EDIT           */" >>$TMPFILE
echo "/*   AUTOMATICALLY GENERATED FILE   */" >>$TMPFILE
echo "/* Edit /etc/horde/horde.php.in and then */" >>$TMPFILE
echo "/* use update-horde to generate this file */" >>$TMPFILE
echo "" >>$TMPFILE
echo "\$default->horde_root_url                 = '$horde_root_url';" >>$TMPFILE
echo "\$default->horde_graphics_url             = '$horde_graphics_url';" >>$TMPFILE
echo "\$default->faq_url                  = '$faq_url';" >>$TMPFILE
echo "\$default->horde_include_dir        = '$horde_include_dir';" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Path to sendmail */" >>$TMPFILE
echo "\$default->path_to_sendmail         = '$path_to_sendmail';" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Problem Reporting */" >>$TMPFILE
echo "\$default->problem_email             = '$problem_email';" >>$TMPFILE
echo "\$default->problem_reporting         = $problem_reporting;" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Account Signup */" >>$TMPFILE
echo "\$default->signup_email              = '$signup_email';" >>$TMPFILE
echo "\$default->signup                    = $signup;" >>$TMPFILE
echo "" >>$TMPFILE
echo "?>" >>$TMPFILE

# Now lets move that file into place

mv $TMPFILE "$HORDE_FILE" > /dev/null 2>&1

##  Now take care of the rest of the conf files needing changed
db_get "horde/database_type"
dbtype="$RET"
db_get "horde/database_server"
dbserver="$RET"
db_get "horde/database_name"
dbname="$RET"
db_get "horde/database_user"
dbuser="$RET"
db_get "horde/database_pass"
dbpass="$RET"
db_get "horde/mysql_pass"
mysqlpass="$RET"

## Now take care of the phplib include file ##
  echo "Creating updated horde_phplib.inc file"
  /bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /etc/horde/horde_phplib.inc.in > /etc/horde/horde_phplib.inc

if [ "$dbtype" = "PostgreSQL" ]; then
 echo "Creating updated prepend.php file"
 /bin/sed -e 's#@@dbtype@@#pgsql#' /etc/horde/prepend.php.in > /etc/horde/prepend.php
 cd /usr/share/horde/lib/src && ./build.pl --database=postgres >> /dev/null 2>&1

fi

if [ "$dbtype" = "MySql" ]; then

 /bin/sed -e 's#@@dbtype@@#mysql#' /etc/horde/prepend.php.in > /etc/horde/prepend.php
 cd /usr/share/horde/lib/src && ./build.pl --database=mysql >> /dev/null 2>&1

fi

echo "Fixing file permissions"
chown -R www-data.www-data /usr/share/horde >> /dev/null 2>&1
chmod -R 555 /usr/share/horde/lib/*.lib >> /dev/null 2>&1
chmod 000 /usr/share/horde/setup.php >> /dev/null 2>&1
chown -R www-data.www-data /etc/horde >> /dev/null 2>&1
chmod 555 `find /etc/horde/ -type f -print ` >/dev/null 2>&1
chmod o-rwx `find /etc/horde/ -type f -print ` >/dev/null 2>&1

db_stop
echo "Done!"
exit 0
@


1.2
log
@[IEM] first round cleanup of debian package for -dev tree.  Bringing 1.2 stable
branch updates into 1.3-dev tree.
@
text
@@


1.1
log
@file update-horde was initially added on branch STABLE_1_2.
@
text
@d1 108
@


1.1.2.1
log
@[IEM] more debconf cleanup. Adding a update-horde script to rebuild config
files after modifying the templates.
@
text
@a0 108
#!/bin/sh -e
# update-horde
#
# written by Ivan E. Moore II <rkrusty@@tdyc.com> with help from
# debconf examples and tons of other references
#
# Source debconf library
. /usr/share/debconf/confmodule
db_version 2.0

case "$1" in
    debconf)
	 db_set "horde/configmethod" "auto"
         echo "Setting configuration method to: debconf"
         exit 0
    ;;
esac
echo ""
echo "Setting configuration method to: Manual"
echo ""
echo "To change back to the debconf method run: update-horde debconf"
echo ""
db_set "horde/configmethod" "manual"

# Where the config file is that stores the previous selections
HORDE_FILE="/etc/horde/horde.php3";
TEMPLATE_FILE="/etc/horde/horde.php3.in";

# Read in template
. "$TEMPLATE_FILE"

# Create a new temp file
TMPFILE=`mktemp /tmp/horde.XXXXXX` || exit 1

# Now let's create the horde.php3 file needed by HORDE
echo "Creating new horde.php3 file"
echo "<?php" >>$TMPFILE
echo "" >>$TMPFILE
echo "/*            DO NOT EDIT           */" >>$TMPFILE
echo "/*   AUTOMATICALLY GENERATED FILE   */" >>$TMPFILE
echo "/* Edit /etc/horde/horde.php3.in and then */" >>$TMPFILE
echo "/* use update-horde to generate this file */" >>$TMPFILE
echo "" >>$TMPFILE
echo "\$default->horde_root_url                 = '$horde_root_url';" >>$TMPFILE
echo "\$default->horde_graphics_url             = '$horde_graphics_url';" >>$TMPFILE
echo "\$default->faq_url                  = '$faq_url';" >>$TMPFILE
echo "\$default->horde_include_dir        = '$horde_include_dir';" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Path to sendmail */" >>$TMPFILE
echo "\$default->path_to_sendmail         = '$path_to_sendmail';" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Problem Reporting */" >>$TMPFILE
echo "\$default->problem_email             = '$problem_email';" >>$TMPFILE
echo "\$default->problem_reporting         = $problem_reporting;" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Account Signup */" >>$TMPFILE
echo "\$default->signup_email              = '$signup_email';" >>$TMPFILE
echo "\$default->signup                    = $signup;" >>$TMPFILE
echo "" >>$TMPFILE
echo "?>" >>$TMPFILE

# Now lets move that file into place

mv $TMPFILE "$HORDE_FILE" > /dev/null 2>&1

##  Now take care of the rest of the conf files needing changed
db_get "horde/database_type"
dbtype="$RET"
db_get "horde/database_server"
dbserver="$RET"
db_get "horde/database_name"
dbname="$RET"
db_get "horde/database_user"
dbuser="$RET"
db_get "horde/database_pass"
dbpass="$RET"
db_get "horde/mysql_pass"
mysqlpass="$RET"

## Now take care of the phplib include file ##
  echo "Creating updated horde_phplib.inc file"
  /bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /etc/horde/horde_phplib.inc.in > /etc/horde/horde_phplib.inc

if [ "$dbtype" = "PostgreSQL" ]; then
 echo "Creating updated prepend.php3 file"
 /bin/sed -e 's#@@dbtype@@#pgsql#' /etc/horde/prepend.php3.in > /etc/horde/prepend.php3
 cd /usr/share/horde/lib/src && ./build.pl --database=postgres >> /dev/null 2>&1

fi

if [ "$dbtype" = "MySql" ]; then

 /bin/sed -e 's#@@dbtype@@#mysql#' /etc/horde/prepend.php3.in > /etc/horde/prepend.php3
 cd /usr/share/horde/lib/src && ./build.pl --database=mysql >> /dev/null 2>&1

fi

echo "Fixing file permissions"
chown -R www-data.www-data /usr/share/horde >> /dev/null 2>&1
chmod -R 555 /usr/share/horde/lib/*.lib >> /dev/null 2>&1
chmod 000 /usr/share/horde/setup.php3 >> /dev/null 2>&1
chown -R www-data.www-data /etc/horde >> /dev/null 2>&1
chmod 555 `find /etc/horde/ -type f -print ` >/dev/null 2>&1
chmod o-rwx `find /etc/horde/ -type f -print ` >/dev/null 2>&1

db_stop
echo "Done!"
exit 0
@


1.1.2.2
log
@[IEM] fixes for update-horde debian script
@
text
@d13 1
a13 1
	 db_set "horde/debconf" "yes"
d23 1
a23 1
db_set "horde/debian" "no"
@


1.1.2.3
log
@[IEM] fixing update-horde issues with database type
@
text
@a79 10
case $dbtype in
  MySql)
    mydbtype="mysql"
    ;; 
  PostgreSQL)
    mydbtype="pgsql"
    ;;
esac


@


1.1.2.4
log
@[IEM] updating debian files..fixing typos in update-horde and other scripts
@
text
@d23 1
a23 1
db_set "horde/debconf" "no"
@


1.1.2.5
log
@[IEM] oops, missed one other call in update-horde that shouldn't be there
anymore
@
text
@d97 1
d104 1
@


1.1.2.6
log
@[IEM] updating debian stuff
@
text
@d11 14
a76 4
db_get "horde/web_user"
webuser="$RET"
db_get "horde/web_group"
webgroup="$RET"
d107 1
a107 1
chown -R $webuser.$webgroup /usr/share/horde >> /dev/null 2>&1
d110 1
a110 1
chown -R $webuser.$webgroup /etc/horde >> /dev/null 2>&1
@


1.1.2.7
log
@About to release debian version 1.2.4-1. Quite a lot of changes now.
@
text
@d2 2
a3 1
# Horde postinst script using debconf
a5 2
# updated by Ola Lundqvist <opal@@debian.org> to automate more of the
# install process.
a6 4
# All questions should have been asked via debconf 
# now we just go get those, build a temp file which we read in and
# then build our config files and set everthing up

d11 4
d16 35
a50 1
. /etc/horde/horde.php3.in
d52 1
a52 13
db_get "horde/web_user"
webuser="$RET"
db_get "horde/web_group"
webgroup="$RET"
db_get "horde/phpversion"
phpver="$RET"
phpini=""
if [ "$phpver" = "php3" ]; then
  phpini=/etc/php3/apache/php3.ini
fi
if [ "$phpver" = "php4" ]; then
  phpini=/etc/php4/apache/php.ini
fi
d63 6
a68 10
db_get "horde/webserver_type"
webtype="$RET"
db_get "horde/dbconfigured"
dbconfigured="$RET"
db_get "horde/dblocal"
dblocal="$RET"
db_get "horde/horderecheck"
hrecheck="$RET"
db_get "horde/restart"
restart="$RET"
a69 1
# These shortnames allow us to make sed statements common
d73 1
a73 1
    ;;
a78 15
# Allows us to loop and substitute in one pass
case $webtype in
  Apache)
    mywebtype="apache"
    ;;
  Apache-SSL)
    mywebtype="apache-ssl"
    ;;
  Both)
    mywebtype="apache apache-ssl"
    ;;
  *)
    mywebtype="none"
    ;;
esac
d80 8
a87 178
for server in $mywebtype; do   
 if [ -f /etc/$server/httpd.conf ]; then
   echo "Web installation seems ok..."
 else 
   mywebtype="none"
 fi
done

# php extensions to verify
extensions="$mydbtype"

#######################################################################################
############################### Phplib update #########################################
#######################################################################################
/bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /etc/horde/horde_phplib.inc.in > /etc/horde/horde_phplib.inc

/bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /usr/share/doc/horde/examples/${mydbtype}_create.sql.in > /etc/horde/${mydbtype}_create.sql

/bin/sed -e "s#@@dbtype@@#${mydbtype}#" /etc/horde/prepend.php3.in > /etc/horde/prepend.php3

db_input "critical" "horde/horderecheck" || true
db_go


#######################################################################################
############################ Non horde stuff, checking ################################
#######################################################################################
# If we're asked to check others' files
if [ "$hrecheck" = "yes" ]; then
  echo "Checking non-HORDE config files"
  #####################################################################################
  ################################# Exim ##############################################
  #####################################################################################
  if [ -e /etc/exim.conf ]; then
    if grep -e "trusted_users.*$webuser:" /etc/exim.conf >&/dev/null; then
      echo "The user $webuser is already trusted by Exim"
    elif grep -e "trusted_users.*=" /etc/exim.conf >&/dev/null; then
      echo "Modifying /etc/exim.conf to add $webuser as a trusted user.";
      /bin/sed -e "s#\(trusted_users *=.*\)#\1:$webuser#" \
	    /etc/exim.conf > /etc/exim.conf.tmp
      cp /etc/exim.conf /etc/exim.conf.bak >/dev/null 2>&1
      if grep -e "trusted_users *=.*$webuser" /etc/exim.conf.tmp >/dev/null 2>&1; then
	mv /etc/exim.conf.tmp /etc/exim.conf >/dev/null 2>&1;
      else
	echo "The script failed while adding $webuser to the trusted users in Exim."
	rm -f /etc/exim.conf.tmp
      fi
    else
      echo "No trusted user line in exim, you have to add that line manually."
    fi
  fi                        
  if [ "$dblocal" = "yes" ]; then
    ###################################################################################
    ############################### PostgreSQL ########################################
    ###################################################################################
    if [ "$dbtype" = "PostgreSQL" ]; then
      chown postgres /etc/horde/pgsql_create.sql
      if [ -f /etc/postgresql/postmaster.init ]; then
        /bin/sed -e 's#\# PGALLOWTCPIP=no#PGALLOWTCPIP=yes#; s#\# PGALLOWTCPIP=yes#PGALLOWTCPIP=yes#' /etc/postgresql/postmaster.init >/etc/postgresql/postmaster.init.tmp
        cp /etc/postgresql/postmaster.init /etc/postgresql/postmaster.init.horde.bak > /dev/null 2>&1
	if grep 'PGALLOWTCPIP=yes' /etc/postgresql/postmaster.init.tmp >/dev/null 2>&1; then
          mv /etc/postgresql/postmaster.init.tmp /etc/postgresql/postmaster.init >/dev/null 2>&1;
        fi
      else
        echo "      **** WARNING ****  "
        echo "You stated your using PostgreSQL as a database and"
        echo "that it is local yet the install program cannot seem"
        echo "to find the config files for it.  The install program"
        echo "will NOT confiugre your database for use with HORDE"
        echo "and thus will not function properly until you get this"
        echo "fixed.  "
        echo " "
        echo "...sleeping for 5 seconds..."
        echo " "
        sleep 5
      fi
    fi
  fi

  #####################################################################################
  ################################ Php3/4 #############################################
  #####################################################################################
  if [ ! -z "$phpini" ]; then
    # Check for php3/4 files
    if [ -f $phpini ]; then
      # Make sure all the extensions are being loaded
      for ext in "$extensions"; do
        echo "checking for $ext $phpver extension configuration"
        if egrep "^[[:space:]]*extension.*$ext\.so" $phpini >/dev/null 2>&1; then
          echo "$phpver extension for $ext found!"
        else
          echo "$phpver extension for $ext added!"
          echo "extension=$ext.so" >>$phpini
        fi
      done
    fi
  fi

  #####################################################################################
  ################################ Apache #############################################
  #####################################################################################
  # Make sure all our web servers are appropriately configured.
  if [ "$mywebtype" = "none" ]; then
    echo "Not configuring web server"
  else 
    for server in $mywebtype; do
      echo "Configuring horde in $server..."
      if [ ! -z "$phpini" ]; then 
	phpverm=$phpver"_module"
        /bin/sed -e "s# *\#  *LoadModule $phpverm#LoadModule $phpverm#" /etc/$server/httpd.conf > /etc/$server/httpd.conf.tmp
	cp /etc/$server/httpd.conf /etc/$server/httpd.conf.horde.back >/dev/null 2>&1
        if grep "$phpver_module" /etc/$server/httpd.conf.tmp >/dev/null 2>&1; then
          mv /etc/$server/httpd.conf.tmp /etc/$server/httpd.conf
        fi
      fi

      ##################################################################################
      ###################### New style config in apache ################################
      ##################################################################################
      if grep -e "Include[[:space:]][[:space:]]*/etc/horde/apache.conf" \
	  /etc/apache/*.conf >& /dev/null; then
        echo "Horde config found in apache config files."
      else
        echo "" >> /etc/$server/httpd.conf
        echo "Include /etc/horde/apache.conf" >> /etc/$server/httpd.conf
      fi
      ##################################################################################
      ######################## Php indexing in apache. #################################
      ##################################################################################
      for A in srm httpd; do
        for B in php php3; do
	  if grep 'DirectoryIndex' /etc/$server/$A.conf >/dev/null 2>&1; then
	    if grep -e "DirectoryIndex.*index.$B" /etc/$server/$A.conf \
	        >/dev/null 2>&1; then
              echo "$B index settings in /etc/$server/$A.conf found!"
            else 
              echo "$B index settings in /etc/$server/$A.conf added!"
              /bin/sed -e "s#\(DirectoryIndex.*index.html\)#\1 index.$B#" \
                  /etc/$server/srm.conf > /etc/$server/$A.conf.new
              if grep -e "DirectoryIndex.*index.$B" /etc/$server/$A.conf.new > /dev/null 2>&1; then
                mv /etc/$server/$A.conf.new /etc/$server/$A.conf
              fi
            fi
          fi
	done
      done
      ##################################################################################
      ######################## Removing old HORDE configs ##############################
      ##################################################################################
      if grep 'Added for HORDE' /etc/$server/access.conf >&/dev/null; then
        echo "HORDE settings in /etc/$server/access.conf found, removing old style."
        cat /etc/$server/access.conf | /usr/share/horde/scripts/remove-oldaccessconfig > /etc/$server/access.conf.new
        if ! grep 'Added for HORDE' /etc/$server/access.conf.new >/dev/null 2>&1; then
          mv /etc/$server/access.conf.new /etc/$server/access.conf
	else
	  echo "Unable to remove the old style, you have to fix this manually."
        fi
      fi
      if grep 'Added for HORDE' /etc/$server/srm.conf >/dev/null 2>&1; then
        MATCH='[[:space:]]*Alias[[:space:]][[:space:]]*/horde[[:space:]][[:space:]]*/usr/share/horde'
        echo "HORDE settings in /etc/$server/srm.conf found, removing old style."
        cat /etc/$server/srm.conf | grep -v 'Added for HORDE' | grep -v "$MATCH" > \
	    /etc/$server/srm.conf.new
	mv /etc/$server/srm.conf /etc/$server/srm.conf.back
	mv /etc/$server/srm.conf.new /etc/$server/srm.conf
	if grep -e "$MATCH" /etc/$server/srm.conf; then
	  cat /etc/$server/srm.conf | grep -v "$MATCH" > \
	    /etc/$server/srm.conf.new
	  mv /etc/$server/srm.conf /etc/$server/srm.conf.back
	  mv /etc/$server/srm.conf.new /etc/$server/srm.conf
	fi
      fi
    done
  fi
  echo "Finished checking non-HORDE config files"
else
  echo "Not checking non-HORDE config files.  I hope everything is"
  echo "configured properly..."
d90 1
a90 53
########################################################################################
############################### Configure local database ###############################
########################################################################################

if [ "$dblocal" = "yes" ]; then
  if [ "$dbconfigured" = "no" ] ; then 
    case $dbtype in
      PostgreSQL)
        if [ -f /etc/postgresql/postmaster.init ]; then
          echo "Trying to configure your PostgreSQL database"
          # FIXME: These statements aren't very robust, they should take
          # into account the possibility of the database being on another
          # host, etc.
          if [ "$restart" = "database" ] || [ "$restart" = "both" ]; then
            su postgres -c "/usr/share/doc/horde/examples/pgsql_cuser.sh $dbuser $dbpass >/dev/null 2>&1" 
            su postgres -c "/usr/bin/psql -q -f /etc/horde/pgsql_create.sql template1 >/dev/null 2>&1" 
            db_set "horde/dbconfigured" "yes"
          else
            echo "Can't setup database because we cannot verify that postgresql"
            echo "was restarted and configured properly"
          fi
        fi
      ;;

    MySql)
      if [ -f /usr/bin/mysql ]; then
        db_reset "horde/mysql_pass"
        db_input "critical" "horde/mysql_pass" || true
        db_go
        db_get "horde/mysql_pass"
        mysqlpass="$RET"
        db_reset "horde/mysql_pass"
        echo "Trying to configure your MySQL database"
        if [ "$mysqlpass" = "none" ] ; then
          /usr/bin/mysql -f < /etc/horde/mysql_create.sql > /dev/null 2>&1
          /usr/bin/mysql -f -e "flush privileges" > /dev/null 2>&1
        else
          /usr/bin/mysql -f --password=$mysqlpass < /etc/horde/mysql_create.sql > /dev/null 2>&1
          /usr/bin/mysql -f --password=$mysqlpass -e "flush privileges" > /dev/null 2>&1         
        fi
        db_set "horde/dbconfigured" "yes"
        else 
          echo "Not configuring MySQL database because we cannot locate"
          echo "the mysql executable"
        fi
      ;;
    esac
  else
    echo "Not configuring database at your request..."
  fi
else
  echo "Not configuring database since it's not local..."
fi
d92 1
d94 1
a94 6
########################################################################################
################################# Horde.php3 ###########################################
########################################################################################
# Now let's create the horde.php3 file needed by HORDE
cat > /etc/horde/horde.php3 <<EOF
<?php
a95 27
/*            DO NOT EDIT           */
/*   AUTOMATICALLY GENERATED FILE   */
/* Edit /etc/horde/horde.php3.in and then */
/* use update-horde to generate this file */

\$default->horde_root_url	= '$horde_root_url';
\$default->horde_graphics_url	= '$horde_graphics_url';
\$default->faq_url		= '$faq_url';
\$default->horde_include_dir	= '$horde_include_dir';

/* Path to sendmail */
\$default->path_to_sendmail	= '$path_to_sendmail';

/* Problem Reporting */
\$default->problem_email	= '$problem_email';
\$default->problem_reporting	= $problem_reporting;

/* Account Signup */
\$default->signup_email		= '$signup_email';
\$default->signup		= $signup;

?>
EOF

########################################################################################
####################### Make sure the perms are right ##################################
########################################################################################
d101 2
a102 33
chmod u+r `find /etc/horde/ -type f -print ` >/dev/null 2>&1
chmod u-wx `find /etc/horde/ -type f -print ` >/dev/null 2>&1
chmod go-rwx `find /etc/horde/ -type f -print ` >/dev/null 2>&1
if [ -f /etc/horde/pgsql_create.sql ]; then
  if [ "$dblocal" = "yes" ]; then
    if [ "$dbtype" = "PostgreSQL" ]; then
      chown postgres /etc/horde/pgsql_create.sql
    fi
  fi
fi

########################################################################################
############################# Servers restart ##########################################
########################################################################################
if [ "$restart" = "database" ] || [ "$restart" = "both" ]; then
  if [ "$dbtype" = "PostgreSQL" ]; then
    if [ -f /etc/postgresql/postmaster.init ]; then
      echo "Restarting PostgreSQL"
      /etc/init.d/postgresql restart > /dev/null 2>&1
    fi
  fi
fi

if [ "$restart" = "webserver" ] || [ "$restart" = "both" ]; then
  for server in $mywebtype; do
    if [ "$server" = "none" ]; then
      echo "Not reloading web server"
    else
      echo "Reloading $mywebtype"
      /etc/init.d/$server reload > /dev/null 2>&1
    fi
  done
fi
d105 1
a105 4

echo "All done"
#DEBHELPER#

a106 1

@


1.1.2.8
log
@Relased version 1.2.4-1.
@
text
@d113 1
a113 1
    if grep -e "trusted_users.*$webuser:" /etc/exim.conf >/dev/null 2>&1; then
d115 1
a115 1
    elif grep -e "trusted_users.*=" /etc/exim.conf >/dev/null 2>&1; then
d198 2
a199 1
      if grep -e "Include[[:space:]][[:space:]]*/etc/horde/apache.conf" /etc/apache/*.conf > /dev/null 2>&1; then
a200 7
	for A in /etc/$server/*.conf; do
	  if grep -e "^[[:space:]]*#[[:space:]]*Include[[:space:]][[:space:]]*/etc/horde/apache.conf" $A > /dev/null 2>&1; then
            echo "Uncommenting import for horde in $A"
	    cat $A | /bin/sed -e "s#^\ *\#\( *Include */etc/horde/apache.conf\)#\1#" > $A.new
	    mv $A.new $A
	  fi
	done
d228 1
a228 1
      if grep 'Added for HORDE' /etc/$server/access.conf >/dev/null 2>&1; then
d230 1
a230 1
        cat /etc/$server/access.conf | /etc/scripts/remove-oldaccessconfig > /etc/$server/access.conf.new
d238 1
a238 1
        MATCH='[[:space:]]*Alias[[:space:]][[:space:]]*/horde/*[[:space:]][[:space:]]*/usr/share/horde/*'
@


1.1.2.9
log
@Major changes, next version of horde.
@
text
@@


