Ffetch_extdir.sh 896 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. #set -x
  3. set -o posix
  4. #set -u
  5. #set -e
  6. #+
  7. # ===============
  8. # Ffetch_extdir.sh
  9. # ===============
  10. # ---------------
  11. # Make the config
  12. # ---------------
  13. # SYNOPSIS
  14. # ========
  15. # ::
  16. # $ Ffetch_extdir.sh
  17. # DESCRIPTION
  18. # ===========
  19. # - Make the config directory
  20. # - Create repositories needed :
  21. #
  22. # - EXP00 for namelist
  23. # - MY_SRC for user sources
  24. # - BLD for compilation
  25. # EXAMPLES
  26. # ========
  27. # ::
  28. # $ ./Ffetch_extdir.sh CONFIG_NAME REMOTE_CTL
  29. # TODO
  30. # ====
  31. # option debug
  32. # EVOLUTIONS
  33. # ==========
  34. # $Id: Ffetch_extdir.sh 3715 2012-11-28 16:06:02Z acc $
  35. # * creation
  36. #-
  37. basedir=$(pwd)
  38. cd ${1}
  39. wget ${2} -O remote_file.list
  40. #
  41. if [ -f remote_file.list ] ; then
  42. cat remote_file.list | grep -v '^#' |
  43. while
  44. read remfile locfile
  45. do
  46. if [ $remfile == 'create_directory' ] ;then
  47. mkdir $locfile
  48. else
  49. wget $remfile -O $locfile
  50. fi
  51. done
  52. fi
  53. cd $basedir