[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-clonage/sources/debian/ -> postrm (source)

   1  #!/bin/sh
   2  # postrm script for se3-clonage
   3  #
   4  # see: dh_installdeb(1)
   5  
   6  set -e
   7  
   8  # summary of how this script can be called:
   9  #        * <postrm> `remove'
  10  #        * <postrm> `purge'
  11  #        * <old-postrm> `upgrade' <new-version>
  12  #        * <new-postrm> `failed-upgrade' <old-version>
  13  #        * <new-postrm> `abort-install'
  14  #        * <new-postrm> `abort-install' <old-version>
  15  #        * <new-postrm> `abort-upgrade' <old-version>
  16  #        * <disappearer's-postrm> `disappear' <overwriter>
  17  #          <overwriter-version>
  18  # for details, see http://www.debian.org/doc/debian-policy/ or
  19  # the debian-policy package
  20  
  21  
  22  case "$1" in
  23      purge)
  24  
  25      ### on suppose que l'on est sous debian  ####
  26      WWWPATH="/var/www"
  27      ## recuperation des variables necessaires pour interoger mysql ###
  28      if [ -e $WWWPATH/se3/includes/config.inc.php ]; then
  29          dbhost=`cat $WWWPATH/se3/includes/config.inc.php | grep "dbhost=" | cut -d = -f2 | cut -d \" -f2`
  30          dbname=`cat $WWWPATH/se3/includes/config.inc.php | grep "dbname=" | cut    -d = -f 2 |cut -d \" -f 2`
  31          dbuser=`cat $WWWPATH/se3/includes/config.inc.php | grep "dbuser=" | cut -d = -f 2 | cut -d \" -f 2`
  32          dbpass=`cat $WWWPATH/se3/includes/config.inc.php | grep "dbpass=" | cut -d = -f 2 | cut -d \" -f 2`
  33      else
  34          echo "Fichier de configuration inaccessible, le script ne peut se poursuivre."
  35          exit 1
  36      fi
  37      ##### REMOVE sudoers entry
  38      if [ "`cat /etc/sudoers | grep SE3CLONAGE`" ]; then
  39          sed -i 's/^\(www-se3.*\),NOPASSWD:SE3CLONAGE\(.*\)$/\1\2/'  /etc/sudoers
  40          sed -i '/^Cmnd_Alias SE3CLONAGE.*$/d' /etc/sudoers
  41          /etc/init.d/sudo restart
  42      fi
  43      #dpkg-divert --package se3-domain --remove --rename /usr/lib/syslinux/pxelinux.0
  44      ;;
  45  
  46      remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
  47      #dpkg-divert --package se3-domain --remove --rename /usr/lib/syslinux/pxelinux.0
  48      ;;
  49  
  50  
  51      *)
  52          echo "postrm called with unknown argument \`$1'" >&2
  53          exit 1
  54      ;;
  55  esac
  56  
  57  # dh_installdeb will replace this with shell code automatically
  58  # generated by other debhelper scripts.
  59  
  60  #DEBHELPER#
  61  
  62  exit 0
  63  
  64  


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