From f01f38d1451130ac040f7ae0a92f2e78754e12d3 Mon Sep 17 00:00:00 2001 From: Brian Zalewski <59970525+ProfessorManhattan@users.noreply.github.com> Date: Mon, 13 May 2024 03:03:40 +0000 Subject: [PATCH] Updated postfix --- .../bin/post-installx/executable_post-postfix.sh | 16 ++++++++++++++-- home/dot_local/etc/cloudflared/config.yml.tmpl | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/home/dot_local/bin/post-installx/executable_post-postfix.sh b/home/dot_local/bin/post-installx/executable_post-postfix.sh index 934e3516..f53c57c3 100644 --- a/home/dot_local/bin/post-installx/executable_post-postfix.sh +++ b/home/dot_local/bin/post-installx/executable_post-postfix.sh @@ -99,7 +99,13 @@ if [ -n "$SENDGRID_API_KEY" ] && [ "$SENDGRID_API_KEY" != "" ]; then fi ### Re-generate the /etc/aliases.db file if [ -f /etc/aliases ]; then - logg info 'Ensuring proper permissions on the /etc/aliases file' && sudo chown $(stat -c "%U:%G" /etc/sudoers) /etc/aliases + if command -v gstat > /dev/null; then + logg info 'Ensuring proper permissions on the /etc/aliases file' && sudo chown $(gstat -c "%U:%G" /etc/sudoers) /etc/aliases + elif command -v stat > /dev/null; then + logg info 'Ensuring proper permissions on the /etc/aliases file' && sudo chown $(stat -c "%U:%G" /etc/sudoers) /etc/aliases + else + logg info 'Neither the gstat or stat command are available - cannot run sudo chown $(stat/gstat -c "%U:%G" /etc/sudoers) /etc/aliases' + fi logg info 'Generating Postfix aliases' && sudo postalias /etc/aliases > /dev/null else logg warn '/etc/aliases is missing which is required for Postfix' @@ -116,7 +122,11 @@ if [ -n "$SENDGRID_API_KEY" ] && [ "$SENDGRID_API_KEY" != "" ]; then if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/postfix/com.apple.postfix.master.plist" ] && ! sudo launchctl list | grep 'postfix.master' > /dev/null; then logg info 'Copying com.apple.postfix.master.plist' sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/postfix/com.apple.postfix.master.plist" /System/Library/LaunchDaemons/com.apple.postfix.master.plist - sudo launchctl load /System/Library/LaunchDaemons/com.apple.postfix.master.plist && logg success 'launchctl load of com.apple.postfix.master successful' + if sudo launchctl list | grep 'com.apple.postfix.master' > /dev/null; then + logg info 'Unloading previous Postfix launch configuration' + sudo launchctl unload /System/Library/LaunchDaemons/com.apple.postfix.master.plist + fi + sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.postfix.master.plist && logg success 'launchctl load of com.apple.postfix.master successful' fi if ! sudo postfix status > /dev/null; then logg info 'Starting postfix' @@ -137,4 +147,6 @@ if [ -n "$SENDGRID_API_KEY" ] && [ "$SENDGRID_API_KEY" != "" ]; then else logg info 'Skipping Postfix configuration because Postfix is not installed' fi +else + logg info 'SENDGRID_API_KEY is undefined so skipping Postfix configuration' fi \ No newline at end of file diff --git a/home/dot_local/etc/cloudflared/config.yml.tmpl b/home/dot_local/etc/cloudflared/config.yml.tmpl index 4734b868..ea0d1c6c 100644 --- a/home/dot_local/etc/cloudflared/config.yml.tmpl +++ b/home/dot_local/etc/cloudflared/config.yml.tmpl @@ -19,7 +19,7 @@ ingress: - hostname: rdp.{{ $baseDomain }} service: rdp://localhost:3389 - hostname: samba.{{ $baseDomain }} - service: localhost:8445 + service: tcp://localhost:8445 - hostname: sftp.{{ $baseDomain }} service: tcp://localhost:2022 - hostname: sftpgo.{{ $baseDomain }}