diff options
author | Luke Smith <luke@lukesmith.xyz> | 2019-04-20 18:57:51 -0400 |
---|---|---|
committer | Luke Smith <luke@lukesmith.xyz> | 2019-04-20 18:57:51 -0400 |
commit | ec3386de382fc09d39fa65e16114dd239401a840 (patch) | |
tree | ca3bb90515673bb5460f47f7505828d44aee222a | |
parent | 9bd972effcd27cc7d9c4caaf1e905a58d1d1bb58 (diff) |
tmpdir only created when necessary
-rwxr-xr-x | mw | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -9,7 +9,6 @@ namere="^[a-z_][a-z0-9_-]*$" # Regex to ensure viable username emailre=".\+@.\+\\..\+" # Regex to confirm valid email address mbsyncrc="$HOME/.mbsyncrc" sslcert="/etc/ssl/certs/ca-certificates.crt" -tmpdir="$(mktemp -d)" getprofiles() { \ unset msmtp_header msmtp_profile mutt_profile mbsync_profile @@ -153,6 +152,7 @@ EOF read -r login printf "\033[0m" [ -z "$login" ] && login="$fulladdr" + tmpdir="$(mktemp -d)" grep "i[0-9]" "$muttdir/personal.muttrc" 2>/dev/null | awk '{print $3}' | sed -e 's/i//g' > "$tmpdir/mutt_used" seq 1 9 > "$tmpdir/mutt_all" idnum=$(diff "$tmpdir/mutt_all" "$tmpdir/mutt_used" | sed -n 2p | awk '{print $2}') |