[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-logonpy/usr/share/se3/sbin/ -> no-gpo-upload.sh (source)

   1  #!/bin/bash
   2  
   3  if [ -e /var/www/se3/includes/config.inc.php ]; then
   4      dbhost=`cat /var/www/se3/includes/config.inc.php | grep "dbhost=" | cut -d = -f 2 |cut -d \" -f 2`
   5      dbname=`cat /var/www/se3/includes/config.inc.php | grep "dbname=" | cut -d = -f 2 |cut -d \" -f 2`
   6      dbuser=`cat /var/www/se3/includes/config.inc.php | grep "dbuser=" | cut -d = -f 2 |cut -d \" -f 2`
   7      dbpass=`cat /var/www/se3/includes/config.inc.php | grep "dbpass=" | cut -d = -f 2 |cut -d \" -f 2`
   8  elif [ -e /etc/SeConfig.ph ]; then
   9      dbhost=$(expr "$(grep mysqlServerIp /etc/SeConfig.ph)" : ".*'\(.*\)'.*")
  10      dbuser=$(expr "$(grep mysqlServerUsername /etc/SeConfig.ph)" : ".*'\(.*\)'.*")
  11      dbpass=$(expr "$(grep mysqlServerPw /etc/SeConfig.ph)" : ".*'\(.*\)'.*")
  12      dbname=$(expr "$(grep connexionDb /etc/SeConfig.ph)" : ".*'\(.*\)'.*")
  13  fi
  14  
  15  BASEDN=$(mysql -N -h $dbhost $dbname -u $dbuser -p$dbpass -e "SELECT value FROM params WHERE name='ldap_base_dn'")
  16  PARCSRDN=$(mysql -N -h $dbhost $dbname -u $dbuser -p$dbpass -e "SELECT value FROM params WHERE name='parcsRdn'")
  17  ADMINRDN=$(mysql -N -h $dbhost $dbname -u $dbuser -p$dbpass -e "SELECT value FROM params WHERE name='adminRdn'")
  18  ADMINPW=$(mysql -N -h $dbhost $dbname -u $dbuser -p$dbpass -e "SELECT value FROM params WHERE name='adminPw'")
  19  
  20  # Nettoyage
  21  find /home/netlogon/machine/ -name no-gpo-upload.lck -exec rm -f {} \;
  22  
  23  #Mise en place
  24  ldapsearch -xLLL -b $PARCSRDN,$BASEDN -D $ADMINRDN,$BASEDN -w $ADMINPW description=no-gpo-upload member|while read line
  25  do  
  26      computer="$(expr "$line" : '.*cn=\([^,]*\).*')"
  27      if [ ! -z $computer ]; then
  28          [ -d /home/netlogon/machine/$computer ] && >/home/netlogon/machine/$computer/no-gpo-upload.lck
  29      fi
  30  done 


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