From 6131d091191b6aa52118f24648776a2e358cc5eb Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 13 Feb 2016 18:32:33 +0000 Subject: [PATCH] port changing --- src/freedombone-controlpanel | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index be6415c9..5cbdcc21 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -589,14 +589,23 @@ function irc_via_onion { 255) return;; esac if [[ $irc_onion == 'no' ]]; then - sed -i "s/;Ports =.*/;Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf - sed -i "s/;Ports =.*/Ports = $IRC_PORT/2" /etc/ngircd/ngircd.conf + if grep -q ";Ports = 6667"; then + sed -i "s/;Ports =.*/;Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf + sed -i "s/;Ports =.*/Ports = $IRC_PORT/2" /etc/ngircd/ngircd.conf + else + sed -i "s/Ports =.*/;Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf + sed -i "s/Ports =.*/Ports = $IRC_PORT/2" /etc/ngircd/ngircd.conf + fi systemctl restart ngircd dialog --title $"IRC Server" \ --msgbox $"The IRC server can now be accessed via SSL at your main domain name" 8 50 else sed -i "s/;Ports =.*/Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf - sed -i "s/;Ports =.*/Ports = $IRC_PORT/2" /etc/ngircd/ngircd.conf + if grep -q ";Ports = 6667"; then + sed -i "s/;Ports =.*/Ports = $IRC_PORT/2" /etc/ngircd/ngircd.conf + else + sed -i "s/Ports =.*/Ports = $IRC_PORT/2" /etc/ngircd/ngircd.conf + fi systemctl restart ngircd dialog --title $"IRC Server" \ --msgbox $"The IRC server can now be accessed via its onion address without SSL" 8 50