Browse Source

fix duble report

pull/23/head
6543 4 years ago
parent
commit
9301b1a39c
  1. 39
      src/func/check_config
  2. 4
      src/func/check_update
  3. 14
      src/remaster.sh

39
src/func/check_config

@ -2,33 +2,12 @@
#remaster lib
[ -d "<LIBDIR>" ] || { 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 "<LIBDIR>/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

4
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 <ROOTDIR>/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
}


14
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 <LIBDIR>/func/check_config

#on_exit [error_level]

Loading…
Cancel
Save