fix duble report

This commit is contained in:
6543 2018-05-20 23:44:26 +02:00
parent c0ddfe7c1c
commit 9301b1a39c
3 changed files with 18 additions and 39 deletions

View File

@ -2,33 +2,12 @@
#remaster lib #remaster lib
[ -d "<LIBDIR>" ] || { echo "LIBDIR not exist"; exit 1; } [ -d "<LIBDIR>" ] || { echo "LIBDIR not exist"; exit 1; }


#check_config [log_file] #check_config
function 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 #Project
[ -f "<LIBDIR>/proj/$distro" ] || { [ -f "<LIBDIR>/proj/$distro" ] || {
echo "No Project \"$distro\" is not supported" | tee -a "$log_file" echo "No Project \"$distro\" is not supported"
return 3 return 3
} }


@ -38,14 +17,14 @@ function check_config() {
#Lable #Lable
[ -z "$iso_lable" ] && iso_lable="$distro" [ -z "$iso_lable" ] && iso_lable="$distro"


echo 'iso_source -> iso_destination' | tee -a "$log_file" echo 'iso_source -> iso_destination'
echo 'iso_source -> squashfs [optinal]' | tee -a "$log_file" echo 'iso_source -> squashfs [optinal]'
else else
if [ -n "$filesystem_source" ] && [ -d "${filesystem_source%/*}" ]; then if [ -n "$filesystem_source" ] && [ -d "${filesystem_source%/*}" ]; then
echo 'iso_source -> squashfs' | tee -a "$log_file" echo 'iso_source -> squashfs'
else else
# ERROR # ERROR
echo "No corect AIM in Settings" | tee -a "$log_file" echo "No corect AIM in Settings"
return 3 return 3
fi fi
fi fi
@ -53,14 +32,14 @@ function check_config() {
if [ -f "$filesystem_source" ]; then if [ -f "$filesystem_source" ]; then
if [ -n "$iso_destination" ]; then if [ -n "$iso_destination" ]; then
# ERROR # 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 return 3
else else
echo 'squashfs -> squashfs' | tee -a "$log_file" echo 'squashfs -> squashfs'
fi fi
else else
# ERROR # ERROR
echo "No corect Source in Settings" | tee -a "$log_file" echo "No corect Source in Settings"
return 3 return 3
fi fi
fi fi

View File

@ -5,9 +5,9 @@
#check_update #check_update
function check_update() { function check_update() {
if curl https://raw.githubusercontent.com/6543/remaster/master/changes/remaster.md | diff - <(zcat <ROOTDIR>/usr/share/doc/remaster/changelog.gz ); then if curl https://raw.githubusercontent.com/6543/remaster/master/changes/remaster.md | diff - <(zcat <ROOTDIR>/usr/share/doc/remaster/changelog.gz ); then
echo 'REMASTER: Aktuell' echo 'INFO: Programm Aktuell'
else else
echo 'REMASTER: Warning: neue Version verfügbar' echo 'WARNUNG: neue Version verfügbar'
fi fi
} }



View File

@ -106,10 +106,10 @@ function main_renew() {
check_dependency check_dependency
error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" 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" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file"


check_update | tee -a "$log_file" check_update >> "$log_file"


[ "$distro" != "" ] && distro="_$distro" [ "$distro" != "" ] && distro="_$distro"


@ -258,12 +258,12 @@ function main_update_pxe() {
check_user check_user
error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file"


check_update | tee -a "$log_file" check_update >> "$log_file"


check_dependency check_dependency
error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" 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" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file"


[ "$distro" != "" ] && distro="_$distro" [ "$distro" != "" ] && distro="_$distro"
@ -383,12 +383,12 @@ function main_update_iso() {
check_user check_user
error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file"


check_update | tee -a "$log_file" check_update >> "$log_file"


check_dependency check_dependency
error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file" 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" error_level="$?"; [ "$error_level" != "0" ] && on_exit $error_level >> "$log_file"


[ "$distro" != "" ] && distro="_$distro" [ "$distro" != "" ] && distro="_$distro"
@ -503,7 +503,7 @@ function main_update_iso() {


### Error Handlings ### ### Error Handlings ###


#check_config [log_file] #check_config
source <LIBDIR>/func/check_config source <LIBDIR>/func/check_config


#on_exit [error_level] #on_exit [error_level]