[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-clonage/sources/scripts/ -> se3_pxe_menu_ou_pas.sh (source)

   1  #!/bin/bash
   2  
   3  # $Id: se3_pxe_menu_ou_pas.sh 8388 2015-01-18 21:52:02Z keyser $
   4  # Auteur: Stephane Boireau
   5  # Dernière modification: 08/11/2010
   6  
   7  # Ajout en visudo:
   8  # Cmnd_Alias SE3CLONAGE=/usr/share/se3/scripts/se3_tftp_boot_pxe.sh,/usr/share/se3/scripts/pxe_gen_cfg.sh,/usr/share/se3/scripts/se3_pxe_menu_ou_pas.sh,/usr/share/se3/scripts/set_password_menu_tftp.sh,/usr/share/se3/scripts/se3_pxe_slitaz_cmdline.sh
   9  
  10  if [ "$1" = "menu" ]; then
  11      cp /tftpboot/tftp_modeles_pxelinux.cfg/menu/* /tftpboot/pxelinux.cfg/
  12  else
  13      cp /tftpboot/tftp_modeles_pxelinux.cfg/standard/* /tftpboot/pxelinux.cfg/
  14  fi
  15  
  16  if [ -n "$2" ]; then
  17      t=$(echo "$2" | sed -e "s|[0-9]||g")
  18      if [ -n "$t" ]; then
  19          tftp_delais_boot_pxe=8
  20      else
  21          tftp_delais_boot_pxe=$2
  22      fi
  23      sed -i "s|###TFTP_DELAIS_BOOT_PXE###|$tftp_delais_boot_pxe|g" /tftpboot/pxelinux.cfg/default
  24  fi
  25  
  26  depot_sysrcd="/var/www/sysresccd"
  27  if [ -e "${depot_sysrcd}/sysrcd.dat" -a -e "${depot_sysrcd}/sysrcd.md5" -a -e "${depot_sysrcd}/autorun2" -a -e "${depot_sysrcd}/scripts.tar.gz" -a -e "/tftpboot/rescue32" -a -e "/tftpboot/altker32" -a -e "/tftpboot/rescue64" ]; then
  28      sed -i "s|###SYSRESCCD###||" /tftpboot/pxelinux.cfg/default
  29  
  30      if [ -e /var/www/se3/includes/config.inc.php ]; then
  31          dbhost=`cat /var/www/se3/includes/config.inc.php | grep "dbhost=" | cut -d = -f 2 |cut -d \" -f 2`
  32          dbname=`cat /var/www/se3/includes/config.inc.php | grep "dbname=" | cut -d = -f 2 |cut -d \" -f 2`
  33          dbuser=`cat /var/www/se3/includes/config.inc.php | grep "dbuser=" | cut -d = -f 2 |cut -d \" -f 2`
  34          dbpass=`cat /var/www/se3/includes/config.inc.php | grep "dbpass=" | cut -d = -f 2 |cut -d \" -f 2`
  35      else
  36          echo "Fichier de conf inaccessible"
  37          exit 1
  38      fi
  39  
  40      se3ip=$(echo "SELECT value FROM params WHERE name='se3ip';"|mysql -N -h $dbhost -u $dbuser -p$dbpass $dbname)
  41      www_sysrcd_ip=$se3ip
  42  
  43      sed -i "s|###WWW_SYSRCD_IP###|${www_sysrcd_ip}|g" /tftpboot/pxelinux.cfg/default
  44  
  45      if [ -e /tftpboot/pxelinux.cfg/linux.menu ]; then
  46          sed -i "s|###SYSRESCCD###||" /tftpboot/pxelinux.cfg/linux.menu
  47          sed -i "s|###WWW_SYSRCD_IP###|${www_sysrcd_ip}|g" /tftpboot/pxelinux.cfg/linux.menu
  48      fi
  49  
  50      if [ -e /tftpboot/pxelinux.cfg/clonage.menu ]; then
  51          sed -i "s|###SYSRESCCD###||" /tftpboot/pxelinux.cfg/clonage.menu
  52          sed -i "s|###WWW_SYSRCD_IP###|${www_sysrcd_ip}|g" /tftpboot/pxelinux.cfg/clonage.menu
  53      fi
  54      
  55      if [ -e /tftpboot/pxelinux.cfg/install.menu ]; then
  56          sed -i "s|###install-linux###||" /tftpboot/pxelinux.cfg/install.menu
  57      fi
  58      
  59      if [ -e /usr/share/se3/scripts/unattended_generate.sh ]; then
  60          sed -i "s|###install-win###||" /tftpboot/pxelinux.cfg/install.menu
  61      fi
  62  fi


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