[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/usr/share/se3/sbin/ -> se3_verif_dispo_clonage.sh (source)

   1  #!/bin/bash
   2  
   3  # $Id: se3_verif_dispo_clonage.sh 8494 2015-03-02 23:43:46Z keyser $
   4  # Auteur:Franck Molle
   5  # Dernière modification: 02/2014
   6  
   7  ##### Permet de créer un compte d'assistance pour l'interface web pdt 1 heure #####
   8  ###
   9  
  10  . /usr/share/se3/includes/config.inc.sh -d
  11  . /usr/share/se3/includes/functions.inc.sh
  12  
  13  COLTITRE="\033[1;35m"   # Rose
  14  COLPARTIE="\033[1;34m"  # Bleu
  15  
  16  COLTXT="\033[0;37m"     # Gris
  17  COLCHOIX="\033[1;33m"   # Jaune
  18  COLDEFAUT="\033[0;33m"  # Brun-jaune
  19  COLSAISIE="\033[1;32m"  # Vert
  20  
  21  COLCMD="\033[1;37m"     # Blanc
  22  
  23  COLERREUR="\033[1;31m"  # Rouge
  24  COLINFO="\033[0;36m"    # Cyan
  25  
  26  # Parametres
  27  timestamp=$(date +%s)
  28  timedate=$(date "+%Y%m%d_%H%M%S")
  29  
  30  
  31  
  32  tmp="/var/se3/tmp_clonage_$timedate}"
  33  mkdir -p "$tmp"
  34  chmod 700 $tmp
  35  cd $tmp
  36  
  37  
  38  
  39  ## Partie udpcast##
  40  
  41  # ========================================
  42  
  43  if [ -n "$udpcast_noyo_version" ]; then
  44      
  45      src_udpcast="http://wawadeb.crdp.ac-caen.fr/iso/udpcast"
  46      
  47      # Valeurs des versions en place recuperees de se3db.params:
  48      version_noyo_udpcast_en_place="$udpcast_noyo_version"
  49      version_initrd_udpcast_en_place="$udpcast_initrd_version"
  50      version_noyo_old_udpcast_en_place="$udpcast_noyo_old_version"
  51      version_initrd_old_udpcast_en_place="$udpcast_initrd_old_version"
  52  
  53      # ========================================
  54  
  55      rm -f versions.txt
  56      wget $src_udpcast/versions.txt > /dev/null 2>&1
  57  
  58  
  59      if [ "$?" = 0 -a -e versions.txt ]; then
  60          version_noyo_udpcast_en_ligne=$(grep ";vmlu26$" versions.txt | cut -d";" -f1)
  61          version_initrd_udpcast_en_ligne=$(grep ";udprd$" versions.txt | cut -d";" -f1)
  62          version_noyo_old_udpcast_en_ligne=$(grep ";vmlu26.old$" versions.txt | cut -d";" -f1)
  63          version_initrd_old_udpcast_en_ligne=$(grep ";udprd.old$" versions.txt | cut -d";" -f1)
  64          
  65  
  66          if [ "$version_noyo_udpcast_en_ligne" = "$version_noyo_udpcast_en_place" -a "$version_initrd_udpcast_en_ligne" = "$version_initrd_udpcast_en_ligne" ]; then
  67              echo "Maj udpcast ok"
  68              SETMYSQL udpcast_ajour "1" "Temoin de mise a jour udpcast" 7
  69          else
  70              echo "Maj udpcast Ko"
  71              SETMYSQL udpcast_ajour "0" "Temoin de mise a jour udpcast" 7
  72          fi
  73      else
  74          echo "ECHEC du telechargement du fichier des versions."
  75          SETMYSQL slitaz_ajour "2" "Temoin de mise a jour slitaz" 7
  76      fi
  77  fi
  78  
  79  
  80  ## Partie Slitaz ##
  81  
  82  if [ -n "$slitaz_noyo_version" ]; then
  83      src_slitaz="http://wawadeb.crdp.ac-caen.fr/iso/slitaz"
  84      
  85      # Valeurs des versions en place recuperees de se3db.params:
  86      version_noyo_slitaz_en_place="$slitaz_noyo_version"
  87      version_rootfs_slitaz_en_place="$slitaz_roofs_version"
  88  
  89      rm -f versions.txt
  90      wget $src_slitaz/versions.txt > /dev/null 2>&1
  91      if [ "$?" = 0 -a -e versions.txt ]; then
  92  
  93          version_noyo_slitaz_en_ligne=$(grep ";bzImage$" versions.txt | cut -d";" -f1)
  94          version_rootfs_slitaz_en_ligne=$(grep ";rootfs.gz$" versions.txt | cut -d";" -f1)
  95          
  96          
  97          if [ "$version_noyo_slitaz_en_ligne" = "$version_noyo_slitaz_en_place" -a "$version_rootfs_slitaz_en_ligne" = "$version_rootfs_slitaz_en_place" ]; then
  98              echo "Maj slitaz ok"
  99              SETMYSQL slitaz_ajour "1" "Temoin de mise a jour slitaz" 7
 100          else
 101              echo "Maj slitaz Ko"
 102              SETMYSQL slitaz_ajour "0" "Temoin de mise a jour slitaz" 7
 103          fi
 104      else
 105          echo "ECHEC du telechargement du fichier des versions slitaz ."
 106          SETMYSQL slitaz_ajour "2" "Temoin de mise a jour slitaz" 7
 107      fi
 108  fi
 109  
 110  # ========================================
 111      
 112      
 113      
 114  ## Partie sysrescd linux##
 115  
 116  if [ -n "$srcd_version" ]; then
 117  
 118      src_sysresccd="http://wawadeb.crdp.ac-caen.fr/iso/sysresccd"
 119      version_srcd_en_place="$srcd_version"
 120      version_autorun2_en_place="$srcd_autorun2_vers"
 121      version_scripts_en_place="$srcd_scripts_vers"
 122  
 123      rm -f versions.txt
 124      wget $src_sysresccd/versions.txt > /dev/null 2>&1
 125      if [ "$?" = 0 -a -e versions.txt ]; then
 126          version_srcd_en_ligne=$(grep ";systemrescuecd.iso$" versions.txt | cut -d";" -f1)
 127          version_autorun2_en_ligne=$(grep ";autorun2$" versions.txt | cut -d";" -f1)
 128          version_scripts_en_ligne=$(grep ";scripts.tar.gz$" versions.txt | cut -d";" -f1)
 129  
 130          if [ "$version_srcd_en_ligne" = "$version_srcd_en_place" -a "$version_autorun2_en_ligne" = "$version_autorun2_en_place" -a "$version_scripts_en_ligne" = "$version_scripts_en_place" ]; then
 131              echo "Maj System Rescue CD ok"
 132              SETMYSQL rescd_ajour "1" "Temoin de mise a jour System Rescue CD" 7
 133          else
 134              echo "Maj System Rescue CD Ko"
 135              SETMYSQL rescd_ajour "0" "Temoin de mise a jour System Rescue CD" 7
 136          fi
 137  
 138          
 139      else
 140          echo "ECHEC du telechargement du fichier des versions System Rescue CD ."
 141          SETMYSQL rescd_ajour "2" "Temoin de mise a jour System Rescue CD" 7
 142      fi
 143  
 144  fi
 145  
 146  
 147  ## Partie client linux##
 148  
 149  if [ -n "$VarchPxeClientLin" ]; then
 150  
 151      VscriptPxeClientLin_en_place="$VscriptPxeClientLin"
 152      VarchPxeClientLin_en_place="$VarchPxeClientLin"
 153      
 154      src_client_linux="http://wawadeb.crdp.ac-caen.fr/iso/client_linux"
 155      rm -f versions.txt
 156      wget $src_client_linux/versions.txt > /dev/null 2>&1
 157      
 158      if [ "$?" = 0 -a -e versions.txt ]; then
 159      VscriptPxeClientLin_en_ligne=$(grep ";install_client_linux_mise_en_place.sh$" versions.txt | cut -d";" -f1)
 160      VarchPxeClientLin_en_ligne=$(grep ";install_client_linux_archive-tftp.tar.gz$" versions.txt | cut -d";" -f1)
 161  
 162  
 163          if [ "$VscriptPxeClientLin_en_ligne" = "$VscriptPxeClientLin_en_place" -a "$VarchPxeClientLin_en_ligne" = "$VarchPxeClientLin_en_place" ]; then
 164              echo "Maj client linux ok"
 165              SETMYSQL clinux_ajour "1" "Temoin de mise a jour client linux" 7
 166          else
 167              echo "Maj client linux Ko"
 168              SETMYSQL clinux_ajour "0" "Temoin de mise a jour client linux" 7
 169          fi
 170  
 171          
 172      else
 173          echo "ECHEC du telechargement du fichier des versions client linux."
 174          SETMYSQL clinux_ajour "2" "Temoin de mise a jour client linux" 7
 175      fi
 176          
 177  fi


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