[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  #!/bin/bash
   2  #shares_Win95: homes
   3  #shares_Win2K: homes
   4  #shares_WinXP: homes
   5  #shares_Vista: homes
   6  #shares_Seven: homes
   7  #shares_CIFSFS: homes
   8  #action: stop
   9  #level: 10
  10  
  11  if [ -e /var/www/se3/includes/config.inc.php ]; then
  12          dbhost=`cat /var/www/se3/includes/config.inc.php | grep "dbhost=" | cut -d = -f 2 |cut -d \" -f 2`
  13          dbname=`cat /var/www/se3/includes/config.inc.php | grep "dbname=" | cut -d = -f 2 |cut -d \" -f 2`
  14          dbuser=`cat /var/www/se3/includes/config.inc.php | grep "dbuser=" | cut -d = -f 2 |cut -d \" -f 2`
  15          dbpass=`cat /var/www/se3/includes/config.inc.php | grep "dbpass=" | cut -d = -f 2 |cut -d \" -f 2`
  16  else
  17          echo "Fichier de conf inaccessible"
  18          exit 1
  19  fi
  20  
  21  
  22  # test pour les clients linux
  23  regex_ip='^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'
  24  machine=$(echo "$2" | grep -E "$regex_ip")
  25  
  26  if [ -z "$machine" ]; then
  27      machine=$(echo "$2" | tr 'A-Z' 'a-z')
  28  else
  29      machinetmp=`nmblookup -A $machine | sed -n '2p' | cut -d' ' -f1 | sed 's/^[ \t]*//;s/[ \t]*$//'`
  30      machine=$(echo "$machinetmp" | tr 'A-Z' 'a-z')
  31  fi
  32  
  33  
  34  
  35  
  36  
  37  echo "update connexions set logouttime=now() where username='$1' and netbios_name='$machine' and logouttime=0;" | mysql -h $dbhost $dbname -u $dbuser -p$dbpass -N
  38  


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