docs: add generation of the base tar.gz to the FAQ
[grml-live.git] / buildd / link_latest.sh
1 #!/bin/sh
2 # Filename:      /usr/share/grml-live/buildd/link_latest.sh
3 # Purpose:       create symlinks to the most recent snapshot ISOs
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2 or any later version.
7 ################################################################################
8
9 set -e
10
11 . /etc/grml/grml-buildd.conf
12
13 [ -n "$MIRROR_DIRECTORY" ] || exit 1
14 cd $MIRROR_DIRECTORY || exit 2
15
16 DAILY_DIR=/srv/mirror/www.grml.org/daily
17
18 cd "$DAILY_DIR"
19 echo "---------------------------" >> "$DAILY_DIR"/.timestamp_link
20 for flavour in grml-medium_lenny   grml-medium_squeeze   grml-medium_sid   grml-small_lenny   grml-small_squeeze  grml-small_sid \
21                grml64-medium_lenny grml64-medium_squeeze grml64-medium_sid grml64-small_lenny grml64-small_squeeze grml64-small_sid \
22                grml64_lenny grml64_squeeze grml64_sid grml_lenny grml_squeeze grml_sid ; do
23   ISO="$(ls -1 $flavour/*.iso | tail -1)"
24   if [ -n "$ISO" ] ; then
25      latest="$(basename ${ISO%%_[0-9]*})_latest.iso"
26      ln -sf $ISO ${latest}
27      # ln -sf ${ISO}.md5 ${latest}.md5
28      # http://bts.grml.org/grml/issue814
29      name=$(awk '{print $2}' "${ISO}".md5)
30      sed "s/$name/$latest/" "${ISO}".md5 > "${latest}".md5
31      echo "$ISO" >> "$DAILY_DIR"/.timestamp_link
32   fi
33 done
34 echo "---------------------------" >> "$DAILY_DIR"/.timestamp_link
35
36 ## END OF FILE #################################################################