Commit ebd39ce8 authored by UltimateByte's avatar UltimateByte Committed by GitHub
Browse files

rework echo

parent c573ca0c
......@@ -40,19 +40,25 @@ fn_logging(){
fi
}
# Give a form to echo messages
fn_echo_form(){
currmessage="$@"
echoform="$(date +%Y-%m-%d_%H:%M:%S) - ${selfname} - ${currmessage}"
}
# Simple echo with date and selfname
# Usage fn_echo "Your Message"
fn_echo(){
currmessage="$@"
echo -e "$(date +%Y-%m-%d_%H:%M:%S) - ${selfname} - ${currmessage}"
fn_echo_form
echo -e "${echoform}"
}
# Echo with date and output to log at the same time
# Usage fn_logecho "Your Message"
fn_logecho(){
fn_echo
echo -e "$(date +%Y-%m-%d_%H:%M:%S) - ${selfname} - ${currmessage}" >> "${log}"
currlog="${currlog}$(echo -e "$(date +%Y-%m-%d_%H:%M:%S) - ${selfname} - ${currmessage}")"
echo -e "${echoform}" >> "${log}"
currlog="${currlog}$(echo -e "${echoform}\n")"
}
# Send mail alert
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment