From 59228b5a14ecf72546704b0094c0013014ebf477 Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Mon, 26 Dec 2011 18:38:21 +0100 Subject: [PATCH] Add additinal checks to make sure convert as well as the necessary files are present for creating the wallper --- etc/grml/fai/config/scripts/GRMLBASE/47-update-wallpaper | 10 ++++++++++ etc/grml/fai/config/scripts/RELEASE/99-update-wallpaper | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/etc/grml/fai/config/scripts/GRMLBASE/47-update-wallpaper b/etc/grml/fai/config/scripts/GRMLBASE/47-update-wallpaper index ca0a303..bd5f8c4 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/47-update-wallpaper +++ b/etc/grml/fai/config/scripts/GRMLBASE/47-update-wallpaper @@ -19,6 +19,16 @@ if [ ! -x "$(which convert)" ]; then exit 0 fi +if [ ! -f "$GRML_BG" ]; then + echo "Could not find Grml background image, skipping wallpaper" + exit 0 +fi + +if [ ! -f "$FONTFILE" ]; then + echo "Could not find font $FONTFILE, skipping wallpaper" + exit 0 +fi + echo "Creating standard wallpaper" convert "$GRML_BG" -gravity center \ diff --git a/etc/grml/fai/config/scripts/RELEASE/99-update-wallpaper b/etc/grml/fai/config/scripts/RELEASE/99-update-wallpaper index 283f54f..675f63a 100755 --- a/etc/grml/fai/config/scripts/RELEASE/99-update-wallpaper +++ b/etc/grml/fai/config/scripts/RELEASE/99-update-wallpaper @@ -15,6 +15,22 @@ GRML_WALLPAPER=${GRML_WALLPAPER:-$target/usr/share/grml/desktop.jpg} echo "Creating release wallpaper" +if [ ! -x "$(which convert)" ]; then + echo "convert not installed, skipping release wallpaper." + exit 0 +fi + +if [ ! -f "$GRML_BG" ]; then + echo "Could not find Grml background image, skipping release wallpaper" + exit 0 +fi + +if [ ! -f "$FONTFILE" ]; then + echo "Could not find font $FONTFILE, skipping release wallpaper" + exit 0 +fi + + convert "$GRML_BG" -gravity center \ -fill white -font "$FONTFILE" \ -pointsize $TITLE_FONTSIZE \ -- 2.1.4