[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-unattended/var/se3/unattended/install/tools/ -> script-update (source)

   1  #!/bin/bash
   2  
   3  #
   4  # This script updates your script files from the official
   5  # unattended repository.
   6  #
   7  # This scripts crawles through your script directory, and
   8  # tries to update every found file from the repository. You can
   9  # define exceptions in this script.
  10  #
  11  # Warning #1: this scripts overwrites YOUR changes to official
  12  # script files without any warning! Please double-check that
  13  # none of your own-written scripts accidentially have the same
  14  # name than any of the official scripts.
  15  #
  16  # Warning #2: it does not add scripts in the repository that are
  17  # not found in your script directory. You have to download
  18  # new scripts once manually.
  19  #
  20  # Warning #3: you might want to call it as cron job, but
  21  # please be not surprised by broken scripts.
  22  # This happens from time to time.
  23  #
  24  
  25  #  you can write exceptions like this:
  26  # exceptions=( "win2ksp4-updates.bat" "win2ksp4-symbols.bat" )
  27  exceptions=( )
  28  
  29  # HTTP-Link to the cvs-repository
  30  SVNLINK="https://unattended.svn.sourceforge.net/svnroot/unattended/trunk/install/scripts"
  31  
  32  # paths to needed programs
  33  WGET=$(which wget)
  34  FIND=$(which find)
  35  GREP=$(which grep)
  36  SORT=$(which sort)
  37  SVN=$(which svn)
  38  
  39  # Change to the scripts directory so paths are correct
  40  cd "$(dirname "$0")"/../scripts
  41  
  42  
  43  if [ ! -f $SVN ]
  44  then
  45     echo \****** INSTALL SVN ON YOUR SYSTEM *************\*
  46  fi
  47  
  48  #If there is SVN information when use svn as it has better support
  49  if [ -f .svn ]
  50  then
  51      $SVN up
  52      exit 0
  53  else
  54      echo \****** MISING SVN INFO *************\*
  55      echo \*            RUN:
  56      echo \*   mv scripts scripts.old
  57      echo \*   svn co $SVNLINK scripts 
  58      echo \****** MISING SVN INFO *************\*
  59  fi
  60  
  61  
  62  # crawl through the script-dir
  63  for file in $($FIND . -type f -name "*.bat" | $GREP -v .svn | $SORT)
  64  do
  65      if [[ "$exceptions[@]%%$file##./}}" != "$exceptions[@]}" ]]; then continue; fi
  66      if $WGET $1 --output-document "$file.$$.tmp" --no-check-certificate $SVNLINK/$file
  67      then
  68          mv "$file.$$.tmp" "$file"
  69      else
  70          rm -f "$file.$$.tmp"
  71      fi
  72  done


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