Differing instructions for onion only

This commit is contained in:
Bob Mottram 2016-02-13 16:45:14 +00:00
parent cb21b6224a
commit 9676af672e
1 changed files with 13 additions and 5 deletions

View File

@ -87,6 +87,7 @@ CONFIGURATION_FILE="${PROJECT_NAME}.cfg"
SSH_PORT=2222
IRC_PORT=6697
IRC_ONION_PORT=8093
# password used for accessing your repo mirrors
MY_MIRRORS_PASSWORD=
@ -7451,9 +7452,9 @@ function install_irc_server {
sed -i 's|;DHFile = /etc/ngircd/dhparams.pem|DHFile = /etc/ssl/certs/ngircd.dhparam|g' /etc/ngircd/ngircd.conf
sed -i 's|;KeyFile = /etc/ssl/private/server.key|KeyFile = /etc/ssl/private/ngircd.key|g' /etc/ngircd/ngircd.conf
if [[ $ONION_ONLY != 'yes' ]]; then
sed -i ":a;N;\$!ba;s/;Ports =.*/;Ports = $IRC_PORT, 9050, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
sed -i ":a;N;\$!ba;s/;Ports =.*/;Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
else
sed -i ":a;N;\$!ba;s/;Ports =.*/Ports = $IRC_PORT, 9050, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
sed -i ":a;N;\$!ba;s/;Ports =.*/Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
fi
sed -i ":a;N;\$!ba;s/;Ports =.*/Ports = $IRC_PORT/2" /etc/ngircd/ngircd.conf
sed -i "s/;Name = #ngircd/Name = #${PROJECT_NAME}/g" /etc/ngircd/ngircd.conf
@ -7489,7 +7490,7 @@ function install_irc_server {
touch /var/run/ngircd/ngircd.pid
chown -R irc:irc /var/run/ngircd
IRC_ONION_HOSTNAME=$(add_onion_service irc ${IRC_PORT} ${IRC_PORT})
IRC_ONION_HOSTNAME=$(add_onion_service irc ${IRC_PORT} ${IRC_ONION_PORT})
if ! grep -q $"IRC onion domain" $COMPLETION_FILE; then
echo "IRC onion domain:$IRC_ONION_HOSTNAME" >> $COMPLETION_FILE
fi
@ -7513,8 +7514,15 @@ function install_irc_server {
echo '==========' >> /home/$MY_USERNAME/README
echo $'To connect to your IRC server in irssi:' >> /home/$MY_USERNAME/README
echo '' >> /home/$MY_USERNAME/README
echo " /server add -auto -ssl $DEFAULTDOMAIN $IRC_PORT" >> /home/$MY_USERNAME/README
echo " /connect $DEFAULT_DOMAIN_NAME" >> /home/$MY_USERNAME/README
if [[ $ONION_ONLY != 'yes' ]]; then
echo " irssi" >> /home/$MY_USERNAME/README
echo " /server add -auto -ssl $DEFAULTDOMAIN $IRC_PORT" >> /home/$MY_USERNAME/README
echo " /connect $DEFAULT_DOMAIN_NAME" >> /home/$MY_USERNAME/README
else
echo " usetorwith irssi" >> /home/$MY_USERNAME/README
echo " /server add -auto $IRC_ONION_HOSTNAME $IRC_PORT" >> /home/$MY_USERNAME/README
echo " /connect $IRC_ONION_HOSTNAME" >> /home/$MY_USERNAME/README
fi
echo " /join #${PROJECT_NAME}" >> /home/$MY_USERNAME/README
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
chmod 600 /home/$MY_USERNAME/README