mirror of
https://gitlab.manjaro.org/applications/manjaro-architect
synced 2024-11-08 01:10:26 +00:00
fix errorlog
This commit is contained in:
parent
66406f5187
commit
02b196d0c2
20
lib/util.sh
20
lib/util.sh
@ -144,22 +144,24 @@ id_system() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# If there is an error, display it and go back to main menu. In any case, write to logfile.
|
# If there is an error, display it and go back to main menu. In any case, write to logfile.
|
||||||
|
# param 2 : error code is optional
|
||||||
check_for_error() {
|
check_for_error() {
|
||||||
local _msg="[$1]"
|
local _msg="$1"
|
||||||
local _err="$2"
|
local _err="${2:-0}"
|
||||||
|
((${_err}!=0)) && _msg="[${_msg}][${_err}]"
|
||||||
[[ -f "${ERR}" ]] && {
|
[[ -f "${ERR}" ]] && {
|
||||||
_msg="${_msg}: $(head -n1 ${ERR})"
|
_msg="${_msg} $(head -n1 ${ERR})"
|
||||||
rm "${ERR}"
|
rm "${ERR}"
|
||||||
}
|
}
|
||||||
if ((${_err}==1)); then
|
if ((${_err}!=0)); then
|
||||||
_msg="ERROR: ${_msg}"
|
# and function varsdump ? _msg="$_msg \n $(declare -p | grep -v " _")"
|
||||||
DIALOG " $_ErrTitle " --msgbox "\n$(cat ${ERR})\n" 0 0
|
echo -e "$(date +%D\ %T) ERROR ${_msg}" >> "${LOGFILE}"
|
||||||
# and function for varsdump ? _msg="$_msg \n $(declare -p | grep -v " _")"
|
DIALOG " $_ErrTitle " --msgbox "\n${_msg}\n" 0 0
|
||||||
main_menu_online
|
main_menu_online
|
||||||
else
|
else
|
||||||
_msg="##${_msg}"
|
echo -e "$(date +%D\ %T) ${_msg}" >> "${LOGFILE}"
|
||||||
fi
|
fi
|
||||||
echo -e "$(date +%D\ %T\ %Z) ${_msg}" >> "${LOGFILE}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add locale on-the-fly and sets source translation file for installer
|
# Add locale on-the-fly and sets source translation file for installer
|
||||||
|
Loading…
Reference in New Issue
Block a user