Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions include.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ add_status(){
text="\e[5;41;1mERROR: $text\e[0m"
fi

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

text="$text\n\nReview $BOOTSTRAP_LOGFILE to analyze what went wrong"
fi

Expand Down