[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-wpkg/sources/scripts/ -> wpkg_initvars.sh (source)

   1  #!/bin/bash
   2  
   3  #########################################################################
   4  #   /usr/share/se3/scripts/wpkg_initvars.sh                             #
   5  #                                                                       #
   6  #########################################################################
   7  #
   8  #
   9  #   Cree un fichier bat /var/se3/unattended/install/wpkg/initvars_se3.bat
  10  #   d'initialisation des paramètres du serveur ( Set variable=valeur ...)
  11  #   Utilisable pour l'install des applis
  12  
  13  #   A executer chaque fois que le parametrage du serveur se3 est change
  14  
  15  ## $Id: wpkg_initvars.sh 6913 2012-02-20 01:53:47Z keyser $ ##
  16  #
  17  
  18  # Chemin du fichier .bat a creer
  19  INITVARSSE3BAT='/var/se3/unattended/install/wpkg/initvars_se3.bat'
  20  
  21  # List des variables a definir
  22  ListVars="'urlse3','lang','ldap_server','ldap_port','ldap_base_dn','adminRdn','peopleRdn','groupsRdn','rightsRdn','parcsRdn','computersRdn','path_to_wwwse3','lcsIp','domain','path2UserSkel','path2BatFiles','path2Templates','path2smbconf','path2slapdconf','path2ldapconf','path2pamldapconf','path2nssldapconf','path2ldapsecret','serv_samba','serv_apache','serv_slapd','serv_nscd','defaultgid','majnbr','autologon','uidPolicy','yala_bind','defaultshell','melsavadmin','savlevel','savbandnbr','savdevice','savhome','savse3','savsuspend','debug','urlmaj','ftpmaj','defaultintlevel','majzinbr','ntpserv','printersRdn','trashRdn','slisip','slis_url','infobul_activ','bpcmedia','backuppc','inventaire','antivirus','affiche_etat','registred','smbversion','domainsid','majdepnbr','dhcp_on_boot','dhcp_iface','dhcp_begin_range','dhcp_end_range','dhcp_dns_server_prim','dhcp_dns_server_sec','dhcp_gateway','dhcp_wins','dhcp_ntp','dhcp_max_lease','dhcp_default_lease','dhcp_domain_name','dhcp_tftp_server','dhcp_unatt_login','dhcp_unatt_pass','dhcp_unatt_filename','dhcp','version','wpkg','menu_fond_ecran'"
  23  
  24  WWWPATH="/var/www"
  25  ## recuperation des variables necessaires pour interoger mysql ###
  26  if [ -e $WWWPATH/se3/includes/config.inc.php ]; then
  27      dbhost=`cat $WWWPATH/se3/includes/config.inc.php | grep "dbhost=" | cut -d = -f2 | cut -d \" -f2`
  28      dbname=`cat $WWWPATH/se3/includes/config.inc.php | grep "dbname=" | cut    -d = -f 2 |cut -d \" -f 2`
  29      dbuser=`cat $WWWPATH/se3/includes/config.inc.php | grep "dbuser=" | cut -d = -f 2 | cut -d \" -f 2`
  30      dbpass=`cat $WWWPATH/se3/includes/config.inc.php | grep "dbpass=" | cut -d = -f 2 | cut -d \" -f 2`
  31  else
  32      echo "Fichier de configuration inaccessible, le script ne peut se poursuivre."
  33      exit 1
  34  fi
  35  
  36  # HashSE3 si un client a besoin de verifier qu'il s'agit de ce serveur
  37  HashSE3existe="0"
  38  if ( grep 'Set HashSE3=' $INITVARSSE3BAT >/dev/null 2>&1); then
  39      HashSE3existe="1"
  40  fi
  41  
  42  # Creation du fichier $INITVARSSE3BAT
  43  . /usr/share/se3/includes/config.inc.sh -m
  44  
  45  # Nom du serveur SE3
  46  echo "Set SE3=$netbios_name" > $INITVARSSE3BAT
  47  
  48  echo "Set IPSE3=$se3ip" >> $INITVARSSE3BAT
  49  
  50  echo "Set DOMAINSE3=$se3_domain" >> $INITVARSSE3BAT
  51  
  52  if [ "$HashSE3existe" == "0" ]; then
  53      perl -e '@c=("A".."Z","a".."z",0..9);print "Set HashSE3=",join("",@c[map{rand @c}(1..16)]),"\n"' >> $INITVARSSE3BAT
  54  fi
  55  
  56  # params
  57  echo "SELECT CONCAT('Set ', name, '=', value) FROM params WHERE name In ($ListVars)" | mysql -h $dbhost $dbname -u $dbuser -p$dbpass -N >> $INITVARSSE3BAT
  58  
  59  todos $INITVARSSE3BAT
  60  


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