From bc5b76001979b779a284ce755ce8ea01f39e4d08 Mon Sep 17 00:00:00 2001 From: Marjan Schiller Date: Tue, 11 Jun 2013 11:14:34 +0200 Subject: [PATCH] Added script to set the liveboot without copy the image. --- liveboot_set_image.sh | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 liveboot_set_image.sh diff --git a/liveboot_set_image.sh b/liveboot_set_image.sh new file mode 100755 index 0000000..31d243d --- /dev/null +++ b/liveboot_set_image.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# copyright 2012-2013 Marjan Schiller +# GPL2 licenced + +set -e +#set -x +export +echo + +# +# check if we have a LIVEBOOT_BUILD_NUMBER +# +if [ "$LIVEBOOT_BUILD_NUMBER" != "" ] ; then + echo "Ok, got LIVEBOOT_BUILD_NUMBER=$LIVEBOOT_BUILD_NUMBER, which is valid." +else + echo "Fail, no LIVEBOOT_BUILD_NUMBER set." + exit 1 +fi + +# +# check if there is an image for it +# +if [ -d /srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_BUILD_NUMBER}/ ] ; then + SOURCE_DIR=$(ls -d /srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_BUILD_NUMBER}/) + echo "Ok, found directory $SOURCE_DIR" +else + figlet "Failure:" + echo "/srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_BUILD_NUMBER}/ does not exist." + exit 1 +fi + +# +# create pending-approval link and rsync again +# +cd /srv/mirror/liveboot +rm -f pending-approval +ln -sfv $(basename $SOURCE_DIR) pending-approval +echo "pending-approval link created, pointing to $SOURCE_DIR" + +# +# finish +# +figlet Ok + -- 2.39.5