[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-internet/sources/debian/ -> postinst (source)

   1  #! /bin/bash
   2  # postinst script for se3-internet
   3  # $$Id: postinst 7225 2012-06-01 22:22:30Z keyser $$
   4  # see: dh_installdeb(1)
   5  
   6  set -e
   7  
   8  # summary of how this script can be called:
   9  #        * <postinst> `configure' <most-recently-configured-version>
  10  #        * <old-postinst> `abort-upgrade' <new version>
  11  #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
  12  #          <new-version>
  13  #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
  14  #          <failed-install-package> <version> `removing'
  15  #          <conflicting-package> <version>
  16  # for details, see http://www.debian.org/doc/debian-policy/ or
  17  # the debian-policy package
  18  #
  19  
  20  case "$1" in
  21      install|configure)
  22  . /usr/share/se3/includes/config.inc.sh -l
  23  
  24  
  25  # installation de la charte
  26  ETABLISSEMENT=`echo "SELECT count(value) FROM params WHERE name='etablissement'" | mysql -h $dbhost $dbname -u $dbuser -p$dbpass -N`
  27  if [ -z "$ETABLISSEMENT" ]; then
  28    echo "insert into params set name='etablissement',value='$ETABLISSEMENT',descr='Nom de l etablissement',cat=1;" | mysql -h $dbhost $dbname -u $dbuser -p$dbpass -N 
  29  fi
  30  
  31  cat /var/www/se3/se3-internet/se3_internet_tables.sql | mysql -h $dbhost $dbname -u $dbuser -p$dbpass -N 2>/dev/null
  32  
  33  
  34  # mise � jour de l'annuaire
  35  
  36  /usr/share/se3/sbin/install-ldap-internet.sh
  37  /usr/share/se3/sbin/reset-internet.sh
  38  
  39  # modification des scripts de connexion samba
  40  /usr/share/se3/sbin/update-share.sh -a netlogon se3-internet.sh Win95
  41  /usr/share/se3/sbin/update-share.sh -a homes se3-internet.sh Win2K WinXP Vista Seven
  42  
  43  # charte internet
  44  # echo  " pour acceder � internet, les utilisateurs doivent signer une charte deux mod�les existent : une simple, qui charge un fichier charte.txt � r�aliser vous -meme (texte ou html) et a placer dans /var/www/se3/se3-internet ou un ficihier multi-pages donn�e � titre d exemple, mais peut-�tre � adapter"
  45  # echo  "  " 
  46  # echo  " voulez vous installer la version simple , multipage ou ne rien changer � votre config [s/m/N]?"
  47  # read reponse
  48  # case "$reponse" in
  49  #     s)
  50  #         if [ -e /var/www/se3/se3-internet/charte_internet.php ]; then        
  51  #             cp /var/www/se3/se3-internet/charte_internet.php /var/www/se3/se3-internet/charte_internet-bak.php
  52  #         fi
  53  #         if [ -e /var/www/se3/se3-internet/charte.txt ]; then        
  54  #             cp /var/www/se3/se3-internet/charte.txt /var/www/se3/se3-internet/charte-bak.txt
  55  #         fi
  56  #         cp /var/www/se3/se3-internet/charte_internet-orig.php /var/www/se3/se3-internet/charte_internet.php
  57  #         cp /var/www/se3/se3-internet/charte-orig.txt /var/www/se3/se3-internet/charte.txt
  58  # 
  59  #         echo  "la version simple est install�e. Vous pouvez editer le fichier charte.txt pour adapter son contenu "
  60  #     ;;
  61  #     m)
  62  #         if [ -e /var/www/se3/se3-internet/charte_internet.php ]; then        
  63  #             cp /var/www/se3/se3-internet/charte_internet.php /var/www/se3/se3-internet/charte_internet-bak.php
  64  #         fi        
  65  #         cp /var/www/se3/se3-internet/charte_internet-exemple.php /var/www/se3/se3-internet/charte_internet.php
  66  #         echo  "La version exemple est install�e, vous pouvez editer le fichier /var/www/se3/se3-internet/charte_internet.php  "
  67  #     ;;
  68  #     *)
  69  #     ;;
  70  # esac
  71   
  72  
  73  
  74  # modification de squidGuard.conf
  75  # SE3=`echo "SELECT value FROM params WHERE name='urlse3'" | mysql -h $dbhost $dbname -u $dbuser -p$dbpass -N`
  76  # if [ -z "$SE3" ]; then
  77  #         echo  "Impossible d'acc�der au param�tre SE3"
  78  #         exit 1
  79  # fi
  80  # SE3=$(echo $SE3 | sed 's/\//\\\//g')
  81  # 
  82  # LDAPIP=`echo "SELECT value FROM params WHERE name='ldap_server'" | mysql -h $dbhost $dbname -u $dbuser -p$dbpass -N`
  83  # if [ -z "$LDAPIP" ]; then
  84  #         echo "Impossible d'acc�der au param�tre ldap_server"
  85  #         exit 1
  86  # fi
  87  # PROXYIP=`echo "SELECT value FROM params WHERE name='lcsIp'" | mysql -h $dbhost $dbname -u $dbuser -p$dbpass -N`
  88  # if [ -z "$PROXYIP" ]; then
  89  #         echo "Impossible d'acc�der au param�tre lcsIp, on supposera que c'est $LDAPIP"
  90  #         echo "Entrez l'adresse du serveur lcs" 
  91  #         read PROXYIP
  92  #         if [ -z "$PROXYIP" ]; then
  93  #             PROXYIP=$LDAPIP
  94  #         fi    
  95  # fi
  96  # squidGuard_conf="/root/squidGuard.conf"
  97  # rep=root
  98  # sed -i 's/#PROXYIP#/'"$"'/g' $squidGuard_conf
  99  # sed -i 's/#LDAPIP#/'"$ldap_server"'/g'  $squidGuard_conf
 100  # sed -i 's/#SE3#/'"$urlse3"'/g'  $squidGuard_conf
 101  # sed -i 's/#COMPUTERSRDN#/'"$computersRdn"'/g'  $squidGuard_conf
 102  # sed -i 's/#BASEDN#/'"$ldap_base_dn"'/g' $squidGuard_conf
 103  # sed -i 's/#REDIRECT#/302:http:\/\/'"$lcsIp"'\/squidGuard\/pageinterdite.html/g'  $squidGuard_conf
 104  # 
 105  # echo -n " le fichier squidGuard.conf a �t� cr�� dans  $squidGuard_conf"
 106  # echo -n " Vous devez installer le paquet lcs-squidguard ou modifier � la main votre proxy"
 107      ;;
 108  
 109      abort-upgrade|abort-remove|abort-deconfigure)
 110  
 111      ;;
 112  
 113      *)
 114          echo "postinst called with unknown argument \`$1'" >&2
 115          exit 1
 116      ;;
 117  esac
 118  /usr/share/se3/includes/config.inc.sh -clpbmsdf
 119  # dh_installdeb will replace this with shell code automatically
 120  # generated by other debhelper scripts.
 121  
 122  #DEBHELPER#
 123  
 124  exit 0
 125  
 126  


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1