Add additinal checks to make sure convert as well as the necessary files are present
authorUlrich Dangel <mru@grml.org>
Mon, 26 Dec 2011 17:38:21 +0000 (18:38 +0100)
committerUlrich Dangel <mru@grml.org>
Mon, 26 Dec 2011 22:02:09 +0000 (23:02 +0100)
for creating the  wallper

etc/grml/fai/config/scripts/GRMLBASE/47-update-wallpaper
etc/grml/fai/config/scripts/RELEASE/99-update-wallpaper

index ca0a303..bd5f8c4 100755 (executable)
@@ -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 \
index 283f54f..675f63a 100755 (executable)
@@ -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 \