-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only reference logfile when log level > info #311
base: main
Are you sure you want to change the base?
Conversation
This avois duplication entries like in this sample. ``` Last login: Sun Sep 29 15:50:41 2024 from 127.0.0.1 INFO: BOOTSTRAP COMPLETE Review the progress in /var/log/install-cloud-in-a-box.log INFO: DEPLOYMENT COMPLETED SUCCESSFULLY Review the progress in /var/log/install-cloud-in-a-box.log ``` Signed-off-by: Christian Berendt <berendt@osism.tech>
I think the duplicate entries are because the backups are made every time add_status is executed. How would that be?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the duplicate entries are because the backups are made every time add_status is executed.
if [[ "$type" = "info" ]] && [[ -n "$BOOTSTRAP_LOGFILE" ]];then | ||
text="$text\n\nReview the progress in $BOOTSTRAP_LOGFILE" | ||
elif [[ -n "$BOOTSTRAP_LOGFILE" ]];then | ||
if [[ -n "$BOOTSTRAP_LOGFILE" ]];then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [[ -n "$BOOTSTRAP_LOGFILE" ]];then | |
if [[ "$type" = "info" ]] && [[ -n "$BOOTSTRAP_LOGFILE" ]];then | |
text="$text\n\nReview the progress in $BOOTSTRAP_LOGFILE" | |
elif [[ -n "$BOOTSTRAP_LOGFILE" ]];then | |
text="$text\n\nReview $BOOTSTRAP_LOGFILE to analyze what went wrong" | |
fi | |
for file_status in /etc/issue.net /etc/issue /etc/motd; do | |
if [ -e "$file_status" ];then | |
sudo cp "$file_status" "${file_status}.backup" | |
else | |
sudo touch "${file_status}.backup" | |
fi | |
(cat "${file_status}.backup"; echo -e "$text") | sudo tee $file_status >/dev/null | |
done |
This avois duplication entries like in this sample.