From 9301b1a39c0c6ad0a9f928d2ea38d2efd346cf07 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 20 May 2018 23:44:26 +0200 Subject: [PATCH] fix duble report --- src/func/check_config | 39 +++++++++------------------------------ src/func/check_update | 4 ++-- src/remaster.sh | 14 +++++++------- 3 files changed, 18 insertions(+), 39 deletions(-) diff --git a/src/func/check_config b/src/func/check_config index 8bed903..fcb70b0 100755 --- a/src/func/check_config +++ b/src/func/check_config @@ -2,33 +2,12 @@ #remaster lib [ -d "" ] || { echo "LIBDIR not exist"; exit 1; } -#check_config [log_file] +#check_config function check_config() { - #LOG - { - log_file=$1 - [ -z "$log_file" ] && log_file="/tmp/remaster_`date '+%Y-%m-%d'`" - - if [ -f "$log_file" ]; then - echo > "$log_file" - else - #check if folder exist - [ -d "${log_file%/*}" ] || { - # N-> exit 3 - echo "Directory for Log didnt exist" - exit 3 - } - #create LOG - touch "$log_file" - fi - } - - - #Project [ -f "/proj/$distro" ] || { - echo "No Project \"$distro\" is not supported" | tee -a "$log_file" + echo "No Project \"$distro\" is not supported" return 3 } @@ -38,14 +17,14 @@ function check_config() { #Lable [ -z "$iso_lable" ] && iso_lable="$distro" - echo 'iso_source -> iso_destination' | tee -a "$log_file" - echo 'iso_source -> squashfs [optinal]' | tee -a "$log_file" + echo 'iso_source -> iso_destination' + echo 'iso_source -> squashfs [optinal]' else if [ -n "$filesystem_source" ] && [ -d "${filesystem_source%/*}" ]; then - echo 'iso_source -> squashfs' | tee -a "$log_file" + echo 'iso_source -> squashfs' else # ERROR - echo "No corect AIM in Settings" | tee -a "$log_file" + echo "No corect AIM in Settings" return 3 fi fi @@ -53,14 +32,14 @@ function check_config() { if [ -f "$filesystem_source" ]; then if [ -n "$iso_destination" ]; then # ERROR - echo "only Squashfs source in Settings, cant creat ISO" | tee -a "$log_file" + echo "only Squashfs source in Settings, cant creat ISO" return 3 else - echo 'squashfs -> squashfs' | tee -a "$log_file" + echo 'squashfs -> squashfs' fi else # ERROR - echo "No corect Source in Settings" | tee -a "$log_file" + echo "No corect Source in Settings" return 3 fi fi diff --git a/src/func/check_update b/src/func/check_update index 7a1847d..79d6d99 100755 --- a/src/func/check_update +++ b/src/func/check_update @@ -5,9 +5,9 @@ #check_update function check_update() { if curl https://raw.githubusercontent.com/6543/remaster/master/changes/remaster.md | diff - <(zcat /usr/share/doc/remaster/changelog.gz ); then - echo 'REMASTER: Aktuell' + echo 'INFO: Programm Aktuell' else - echo 'REMASTER: Warning: neue Version verfügbar' + echo 'WARNUNG: neue Version verfügbar' fi } diff --git a/src/remaster.sh b/src/remaster.sh index 391083b..ddcd498 100755 --- a/src/remaster.sh +++ b/src/remaster.sh @@ -106,10 +106,10 @@ function main_renew() { check_dependency error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - check_config "$log_file" + check_config >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - check_update | tee -a "$log_file" + check_update >> "$log_file" [ "$distro" != "" ] && distro="_$distro" @@ -258,12 +258,12 @@ function main_update_pxe() { check_user error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - check_update | tee -a "$log_file" + check_update >> "$log_file" check_dependency error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - check_config "$log_file" + check_config >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" [ "$distro" != "" ] && distro="_$distro" @@ -383,12 +383,12 @@ function main_update_iso() { check_user error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - check_update | tee -a "$log_file" + check_update >> "$log_file" check_dependency error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" - check_config "$log_file" + check_config >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" [ "$distro" != "" ] && distro="_$distro" @@ -503,7 +503,7 @@ function main_update_iso() { ### Error Handlings ### -#check_config [log_file] +#check_config source /func/check_config #on_exit [error_level]