From 677d506dec30d175fcfecdd84c3dc8147f8848d1 Mon Sep 17 00:00:00 2001
From: Holger Paradies <retabell@gmx.de>
Date: Fri, 26 Mar 2021 13:04:14 +0100
Subject: Nightly build add function

Function to check for possible Errors
during build and remove iso then.
---
 nightly_build.bash | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/nightly_build.bash b/nightly_build.bash
index b509781..f0fc026 100755
--- a/nightly_build.bash
+++ b/nightly_build.bash
@@ -1,5 +1,45 @@
 #!/bin/bash
 cd "$(dirname "$0")"
+function check_iso {
+
+# check for possible errors in iso file
+
+echo "K: Kanotix start iso check..." >>binary.log
+    IERR=0
+if grep -F -q "E: " binary.log; then
+    echo "K: ERROR found...1" >>binary.log
+    IERR=1
+fi
+if grep -F -q "Err:" binary.log; then
+    echo "K: ERROR found...2" >>binary.log
+    IERR=2
+fi
+if grep ^parted binary.packages|grep kanotix >/dev/null; then
+    echo
+else
+    echo "K: non kanotix parted version found" >>binary.log
+    echo "K: ERROR found...3" >>binary.log
+    IERR=3
+fi
+if grep -q ^winetricks binary.packages; then
+    if grep ^winetricks binary.packages|grep kanotix >/dev/null; then
+        echo
+    else
+        echo "K: non kanotix winetricks version found" >>binary.log
+        echo "K: ERROR found...4" >>binary.log
+        IERR=4
+    fi
+fi
+if [ $IERR -eq 0 ]; then
+echo "K: Kanotix iso check passed..." >>binary.log
+else
+echo "K: Kanotix iso check errors detected... removing iso" >>binary.log
+rm -f kanotix*.iso
+fi
+
+return $IERR
+}
+
 rm -rf cache tmpfs/cache
 
 # delete iso files older 35 days
-- 
cgit v1.0