this script only install now

This commit is contained in:
Michel Roux 2016-10-07 11:17:24 +02:00
parent 52d5991070
commit 6028f8c6a6

View File

@ -37,7 +37,6 @@ install_exim() {
/usr/share/doc/exim4-base/examples/exim-gencert /usr/share/doc/exim4-base/examples/exim-gencert
openssl genrsa -out /etc/exim4/dkim.key 2048 openssl genrsa -out /etc/exim4/dkim.key 2048
install_restart install_restart
gen_public_dns
} }
install_spamassassin() { install_spamassassin() {
@ -68,34 +67,20 @@ install_restart() {
service exim4 restart service exim4 restart
} }
gen_public_dns() {
DNS=$(openssl rsa -in /etc/exim4/dkim.key -pubout)
DNS=$(echo ${DNS} | sed "s/ //g" | sed "s/.*Y-----\(.*\)-----E.*/\1/g")
echo -e "${YEL}Please put these pointers on your DNS provider :${STD}"
echo -e '\t\t10800 IN MX 10 <domain>'
echo -e '\t\t10800 IN TXT "v=spf1 a -all"'
echo -e '_domainkey\t10800 IN TXT "o=~; r=postmaster@<domain>"'
echo -e "x._domainkey\t10800 IN TXT \"v=DKIM1; k=rsa; p=${DNS}\""
echo -e '_dmarc\t\t10800 IN TXT "v=DMARC1; p=quarantine"'
read -p "Press [Enter] key to continue..."
}
install_mailserver() { install_mailserver() {
echo "Do you want to install extra software ?" echo "Do you want to install extra software ?"
echo "1. None" echo "1. None"
echo "2. SpamAssassin (antispam)" echo "2. SpamAssassin (antispam)"
echo "3. ClamAV (antivirus)" echo "3. ClamAV (antivirus)"
echo "4. Both SpamAssassin and ClamAV" echo "4. Both SpamAssassin and ClamAV"
echo "5. Show DNS config" echo "5. Exit"
echo "6. Exit" read -p "Enter choice [1 - 5] " choice
read -p "Enter choice [1 - 6] " choice
case $choice in case $choice in
1) install_exim ;; 1) install_exim ;;
2) install_exim && install_spamassassin ;; 2) install_exim && install_spamassassin ;;
3) install_exim && install_clamav ;; 3) install_exim && install_clamav ;;
4) install_exim && install_spamassassin && install_clamav ;; 4) install_exim && install_spamassassin && install_clamav ;;
5) gen_public_dns ;; 5) exit ;;
6) exit ;;
*) clear && echo -e "${RED}Please enter a valid input${STD}" && install_mailserver ;; *) clear && echo -e "${RED}Please enter a valid input${STD}" && install_mailserver ;;
esac esac
} }