Replaced log with logg

This commit is contained in:
Brian Zalewski 2023-11-05 03:19:29 +00:00
parent cd08285275
commit 55516e373a
3 changed files with 9 additions and 5 deletions

View file

@ -45,10 +45,10 @@ if command -v install-program > /dev/null; then
export HOMEBREW_NO_ENV_HINTS=true export HOMEBREW_NO_ENV_HINTS=true
if ! command -v gcc-11; then if ! command -v gcc-11; then
if command -v gcc; 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 sudo ln -s "$(which gcc)" /usr/local/bin/gcc-11
else 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
fi fi
if [ -f "$HOME/.bashrc" ]; then if [ -f "$HOME/.bashrc" ]; then

View file

@ -92,7 +92,11 @@ if command -v postfix > /dev/null; then
### Update aliases ### Update aliases
if [ -f /etc/aliases ]; then if [ -f /etc/aliases ]; then
logg info 'Forward root e-mails to {{ .user.email }}' 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 if ! cat /etc/aliases | grep '{{ .user.username }}: root' > /dev/null; then
logg info 'Forward user e-mail to root@localhost' logg info 'Forward user e-mail to root@localhost'
echo '{{ .user.username }}: root' | sudo tee -a /etc/aliases > /dev/null echo '{{ .user.username }}: root' | sudo tee -a /etc/aliases > /dev/null

View file

@ -24,10 +24,10 @@ if command -v install-program > /dev/null; then
export HOMEBREW_NO_ANALYTICS=1 export HOMEBREW_NO_ANALYTICS=1
if ! command -v gcc-11; then if ! command -v gcc-11; then
if command -v gcc; 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 sudo ln -s "$(which gcc)" /usr/local/bin/gcc-11
else 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
fi fi
if [ -f "$HOME/.bashrc" ]; then if [ -f "$HOME/.bashrc" ]; then