From 55516e373ac13d43c2a9633b55d84d29b77aa779 Mon Sep 17 00:00:00 2001 From: Brian Zalewski <59970525+ProfessorManhattan@users.noreply.github.com> Date: Sun, 5 Nov 2023 03:19:29 +0000 Subject: [PATCH] Replaced log with logg --- .../after/run_onchange_after_12-install-packages.sh.tmpl.md | 4 ++-- .../universal/run_onchange_after_05-postfix.sh.tmpl | 6 +++++- .../run_onchange_after_12-install-packages.sh.tmpl | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/scripts/after/run_onchange_after_12-install-packages.sh.tmpl.md b/docs/scripts/after/run_onchange_after_12-install-packages.sh.tmpl.md index ae904e3f..5304ec8e 100644 --- a/docs/scripts/after/run_onchange_after_12-install-packages.sh.tmpl.md +++ b/docs/scripts/after/run_onchange_after_12-install-packages.sh.tmpl.md @@ -45,10 +45,10 @@ if command -v install-program > /dev/null; then export HOMEBREW_NO_ENV_HINTS=true if ! command -v gcc-11; then if command -v gcc; then - log info 'gcc-11 command missing. Symlinking to gcc' + logg info 'gcc-11 command missing. Symlinking to gcc' sudo ln -s "$(which gcc)" /usr/local/bin/gcc-11 else - log warn 'gcc either needs to be added to the PATH or it is missing' + logg warn 'gcc either needs to be added to the PATH or it is missing' fi fi if [ -f "$HOME/.bashrc" ]; then diff --git a/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl index ad6018c0..e6dfe787 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_05-postfix.sh.tmpl @@ -92,7 +92,11 @@ if command -v postfix > /dev/null; then ### Update aliases if [ -f /etc/aliases ]; then logg info 'Forward root e-mails to {{ .user.email }}' - sudo sed s/#root.*/root:\ {{ .user.email }}/ -i /etc/aliases + ALIASES_TMP="$(mktemp)" + logg info 'Setting {{ .user.email }} as root e-mail in temporary file' + sudo sed "s/#root.*/root:\ {{ .user.email }}/" /etc/aliases > "$ALIASES_TMP" + logg info 'Moving temporary file to /etc/aliases' + sudo mv -f "$ALIASES_TMP" /etc/aliases if ! cat /etc/aliases | grep '{{ .user.username }}: root' > /dev/null; then logg info 'Forward user e-mail to root@localhost' echo '{{ .user.username }}: root' | sudo tee -a /etc/aliases > /dev/null diff --git a/home/.chezmoiscripts/universal/run_onchange_after_12-install-packages.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_12-install-packages.sh.tmpl index c6e209da..63b6b693 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_12-install-packages.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_12-install-packages.sh.tmpl @@ -24,10 +24,10 @@ if command -v install-program > /dev/null; then export HOMEBREW_NO_ANALYTICS=1 if ! command -v gcc-11; then if command -v gcc; then - log info 'gcc-11 command missing. Symlinking to gcc' + logg info 'gcc-11 command missing. Symlinking to gcc' sudo ln -s "$(which gcc)" /usr/local/bin/gcc-11 else - log warn 'gcc either needs to be added to the PATH or it is missing' + logg warn 'gcc either needs to be added to the PATH or it is missing' fi fi if [ -f "$HOME/.bashrc" ]; then