From f0489fc8f7312a696bc97c0ec6e69a5b399dae80 Mon Sep 17 00:00:00 2001 From: Richard Bullington-McGuire Date: Sat, 20 Jan 2024 12:16:50 -0500 Subject: [PATCH] Add tidy, fix mail symlink script --- mail-symlink-inbox.sh | 9 +++++++-- tiamat-install.sh | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/mail-symlink-inbox.sh b/mail-symlink-inbox.sh index 4699799..42da068 100755 --- a/mail-symlink-inbox.sh +++ b/mail-symlink-inbox.sh @@ -4,6 +4,9 @@ set -euo pipefail DEBUG=${DEBUG:-false} +# Thanks https://stackoverflow.com/a/17805088 +$DEBUG && export PS4='${LINENO}: ' && set -x + # Symlink /home/user/mail/inbox to /var/spol/mail/inbox # This lets dovecot autodetect the ~/mail directory - needed # as part of the emergency migration to Obscure's new server. @@ -15,8 +18,9 @@ DEBUG=${DEBUG:-false} # https://doc.dovecot.org/configuration_manual/mail_location/ cd /home find . -maxdepth 2 -type d -name mail | while read -r mailuser; do - user=$(cut -d/ -f1 <<<"$mailuser") - $DEBUG && echo "$user" + $DEBUG && echo -n "mailuser:$mailuser" + user=$(cut -d/ -f2 <<<"$mailuser") + $DEBUG && echo "user:$user" mail="/home/$user/mail" inboxlink="$mail/inbox" varspool="/var/spool/mail/$user" @@ -28,3 +32,4 @@ find . -maxdepth 2 -type d -name mail | while read -r mailuser; do $DEBUG && echo "$user did not qualify" fi done +exit 0 diff --git a/tiamat-install.sh b/tiamat-install.sh index 9b3e3d2..000738b 100755 --- a/tiamat-install.sh +++ b/tiamat-install.sh @@ -86,7 +86,9 @@ whois extra_packages=' alpine -shellcheck' +ntfs-3g +shellcheck +tidy' firewall_services_allow=' dns