From 96c2492e6de2b7052f049e7645d182b883a107f3 Mon Sep 17 00:00:00 2001 From: inktrap Date: Tue, 27 Oct 2020 23:49:46 +0100 Subject: [PATCH 1/2] extend list to also work for symlinked accounts --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index cf5011a..3e83ab2 100755 --- a/bin/mw +++ b/bin/mw @@ -30,7 +30,7 @@ do [ -f "$x" ] && sslcert="$x" && break done || { echo "CA Certificate not found. Please install one or link it to /etc/ssl/certs/ca-certificates.crt" && exit 1 ;} -getaccounts() { accounts="$(find "$accdir" -type f | grep -o "[0-9]-.*.muttrc" | sed "s/-/: /;s/\.muttrc$//" | sort -n)" ;} +getaccounts() { accounts="$(find "$accdir" -type f -or -type l | grep -o "[0-9]-.*.muttrc" | sed "s/-/: /;s/\.muttrc$//" | sort -n)" ;} list() { getaccounts && [ -n "$accounts" ] && echo "$accounts" ;} From 16a5a450a4e9d65bbf6823a95ac37de9d2ed2aec Mon Sep 17 00:00:00 2001 From: inktrap Date: Wed, 28 Oct 2020 01:04:14 +0100 Subject: [PATCH 2/2] use -L --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index 3e83ab2..b00f597 100755 --- a/bin/mw +++ b/bin/mw @@ -30,7 +30,7 @@ do [ -f "$x" ] && sslcert="$x" && break done || { echo "CA Certificate not found. Please install one or link it to /etc/ssl/certs/ca-certificates.crt" && exit 1 ;} -getaccounts() { accounts="$(find "$accdir" -type f -or -type l | grep -o "[0-9]-.*.muttrc" | sed "s/-/: /;s/\.muttrc$//" | sort -n)" ;} +getaccounts() { accounts="$(find -L "$accdir" -type f | grep -o "[0-9]-.*.muttrc" | sed "s/-/: /;s/\.muttrc$//" | sort -n)" ;} list() { getaccounts && [ -n "$accounts" ] && echo "$accounts" ;}