[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/usr/share/se3/shares/shares.avail/ -> disableProfsShare.sh (source)

   1  #!/bin/bash
   2  #shares_Win95: prof
   3  #shares_Win2K: prof
   4  #shares_WinXP: prof
   5  #shares_Vista: prof
   6  #shares_Seven: prof
   7  #action: start
   8  #level: 01
   9  
  10  WWWPATH="/var/www"
  11  if [ -e $WWWPATH}/se3/includes/config.inc.php ]
  12  then
  13      dbhost=`cat $WWWPATH}/se3/includes/config.inc.php | grep "dbhost=" | cut -d = -f 2 |cut -d \" -f 2`
  14      dbname=`cat $WWWPATH}/se3/includes/config.inc.php | grep "dbname=" | cut -d = -f 2 |cut -d \" -f 2`
  15      dbuser=`cat $WWWPATH}/se3/includes/config.inc.php | grep "dbuser=" | cut -d = -f 2 |cut -d \" -f 2`
  16      dbpass=`cat $WWWPATH}/se3/includes/config.inc.php | grep "dbpass=" | cut -d = -f 2 |cut -d \" -f 2`
  17  
  18      BASEDN=$(mysql -h $dbhost $dbname -u $dbuser -p$dbpass -N -e "SELECT value FROM params WHERE name='ldap_base_dn'")
  19      if [ -z "$BASEDN" ]; then
  20              echo "Impossible d'acceder au parametre BASEDN"
  21              exit 1
  22      fi
  23      PARCSRDN=$(mysql -h $dbhost $dbname -u $dbuser -p$dbpass -N -e "SELECT value FROM params WHERE name='parcsRdn'")
  24      if [ -z "$PARCSRDN" ]; then
  25              echo "Impossible d'acceder au parametre PARCSRDN"
  26              exit 1
  27      fi
  28      /usr/share/se3/sbin/isMemberOf.pl prof "cn=$2,$PARCSRDN,$BASEDN" >/dev/null 2>&1
  29      if [ "$?" != "0" ]
  30      then
  31          echo "$2 ne fait pas parti du parc $1."
  32  
  33          exit 1
  34      fi
  35  else
  36      exit 1
  37  fi
  38  exit 0


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