From 4b9b111d27948090fac2a96988041c318f6259d8 Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 10 Feb 2018 11:02:44 -0700 Subject: reordering, services file added --- mutt_install.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'mutt_install.sh') diff --git a/mutt_install.sh b/mutt_install.sh index c9ac842..53be42b 100755 --- a/mutt_install.sh +++ b/mutt_install.sh @@ -1,4 +1,5 @@ #!/bin/bash + muttdir="$HOME/.config/mutt/" mkdir -p ~/.config/mutt/credentials @@ -16,13 +17,15 @@ fulladdr=$(\ # Check to see if domain is in domain list serverinfo=$(cat autoconf/domains.csv | grep -w ^${fulladdr##*@}) -if [ -z "$serverinfo" ]; then echo No suitable match. && exit; fi - +if [ -z "$serverinfo" ]; + then + echo No suitable match. && exit + else # Read in server data as variables IFS=, read service imap iport smtp sport spoolfile postponed record < /tmp/$title + gpg -r $youremail --encrypt /tmp/$title + shred -u /tmp/$title && echo "Password encrypted and memory shredded." + mv /tmp/$title.gpg ~/.config/mutt/credentials/ + + # Creating the offlineimaprc if it doesn't exist already. if [ ! -f ~/.offlineimaprc ]; then cp "$muttdir"autoconf/offlineimap_header ~/.offlineimaprc; fi cat "$muttdir"autoconf/offlineimap_profile | sed -e "$replacement" >> ~/.offlineimaprc + # Add the mutt profile. cat "$muttdir"autoconf/mutt_profile | sed -e "$replacement" > "$muttdir"accounts/$title.muttrc + # Add on offlineimaprc sync list. sed -i "s/^accounts =.*[a-zA-Z]$/&, $title/g;s/^accounts =$/accounts = $title/g" ~/.offlineimaprc ;} addAccount - -dialog --title "Luke's mutt/offlineIMAP password wizard" --passwordbox "Enter the password for the \"$title\" account." 10 60 2> /tmp/$title -gpg -r $youremail --encrypt /tmp/$title -shred -u /tmp/$title && echo "Password encrypted and memory shredded." -mv /tmp/$title.gpg ~/.config/mutt/credentials/ - -echo Done lmao. -exit +clear -- cgit v1.2.3