Skip to content

Instantly share code, notes, and snippets.

@msaulohenrique
Created September 30, 2018 20:28
Show Gist options
  • Save msaulohenrique/9bd48a6852e0a144c43ebf7ccaef1937 to your computer and use it in GitHub Desktop.
Save msaulohenrique/9bd48a6852e0a144c43ebf7ccaef1937 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
clear
YELLOW=`tput setaf 3`
GREEN=`tput setaf 2`
NC=`tput sgr0`
echo "${GREEN}"
echo "===================================================="
echo "Adicionar SSL ao uma porta de Rádio"
echo "===================================================="
echo "${NC}"
echo "${YELLOW}Porta da rádio${NC}"
read -e porta
echo "${YELLOW}Porta SSL${NC}"
read -e portassl
echo "${YELLOW}Deseja prosseguir? (y/n)${NC}"
read -e run
if [ "$run" == n ] ; then
exit
else
echo '[portasrv]' >> /etc/stunnel/stunnel.conf
echo 'accept=sslsrv' >> /etc/stunnel/stunnel.conf
echo 'connect=portasrv' >> /etc/stunnel/stunnel.conf
replace 'sslsrv' $portassl -- /etc/stunnel/stunnel.conf
replace 'portasrv' $porta -- /etc/stunnel/stunnel.conf
/etc/init.d/stunnel restart
/etc/init.d/stunnel start
clear
echo "${GREEN}"
echo "================================================================="
echo
echo "Concluído. :)"
echo "SSL na Porta $portassl"
echo "Porta sem SSL $porta"
echo
echo "================================================================="
echo "${NC}"
fi
@msaulohenrique
Copy link
Author

msaulohenrique commented Sep 30, 2018

bash <(curl -L https://gist.githubusercontent.com/msaulohenrique/9bd48a6852e0a144c43ebf7ccaef1937/raw/5790b62af179369cfbe7303c78efb5dd420240ff/ssl_port.sh)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment