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 ################################################################################
13 if [ -r /etc/grml/grml-buildd.conf ] ; then
14 . /etc/grml/grml-buildd.conf
15 elif [ -r "${dir}/grml-buildd.conf" ] ; then
16 . "${dir}/grml-buildd.conf"
19 # directory where daily ISOs are stored locally
20 if [ -z "$MIRROR_DIRECTORY" ] ; then
21 echo "Error: \$MIRROR_DIRECTORY is not set. Exiting." >&2
25 if [ -z "$FLAVOURS" ] ; then
26 echo "Error: \$FLAVOURS is not set. Exiting." >&2
30 if ! cd "$MIRROR_DIRECTORY" ; then
31 echo "Error: could not change directory to $MIRROR_DIRECTORY" >&2
35 echo "---------------------------" >> "$MIRROR_DIRECTORY"/.timestamp_link
36 for flavour in $FLAVOURS; do
37 ISO="$(ls -1 $flavour/*.iso | tail -1)"
38 if [ -n "$ISO" ] ; then
39 latest="$(basename ${ISO%%_[0-9]*})_latest.iso"
41 # ln -sf ${ISO}.md5 ${latest}.md5
42 # http://bts.grml.org/grml/issue814
43 name=$(awk '{print $2}' "${ISO}".md5)
44 sed "s/$name/$latest/" "${ISO}".md5 > "${latest}".md5
45 name=$(awk '{print $2}' "${ISO}".sha1)
46 sed "s/$name/$latest/" "${ISO}".sha1 > "${latest}".sha1
47 echo "$ISO" >> "$MIRROR_DIRECTORY"/.timestamp_link
50 echo "---------------------------" >> "$MIRROR_DIRECTORY"/.timestamp_link
52 ## END OF FILE #################################################################