Don't need separate irc configurations

This commit is contained in:
Bob Mottram 2016-04-17 14:25:20 +01:00
parent 8cfea0d1a9
commit 856d1f22a1
1 changed files with 2 additions and 48 deletions

View File

@ -741,50 +741,6 @@ function change_ssh_public_key {
esac
}
function irc_via_onion {
if [ ! -f /lib/systemd/system/ngircd.service ]; then
dialog --title $"IRC Server" \
--msgbox $"ngircd systemd daemon not found" 8 50
return
fi
dialog --title $"IRC Server" \
--backtitle $"Freedombone Control Panel" \
--defaultno \
--yesno $"\nAccess the IRC server via an onion address?" 8 60
sel=$?
irc_onion='no'
case $sel in
0) irc_onion='yes';;
255) return;;
esac
if [[ $irc_onion == 'no' ]]; then
if grep -q ";Ports = 6667" /etc/ngircd/ngircd.conf; then
sed -i "s/;Ports =.*/;Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
else
if ! grep -q ";Ports = $IRC_PORT, $IRC_ONION_PORT" /etc/ngircd/ngircd.conf; then
sed -i "s/Ports = $IRC_PORT, $IRC_ONION_PORT/;Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
fi
fi
systemctl stop ngircd
sed -i 's|ExecStart.*|ExecStart=/usr/sbin/ngircd|g' /lib/systemd/system/ngircd.service
systemctl daemon-reload
systemctl start ngircd
dialog --title $"IRC Server" \
--msgbox $"The IRC server can now be accessed via SSL at your main domain name" 8 50
else
if grep -q ";Ports = $IRC_PORT, $IRC_ONION_PORT" /etc/ngircd/ngircd.conf; then
sed -i "s/;Ports =.*/Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
systemctl stop ngircd
sed -i 's|ExecStart.*|ExecStart=/usr/bin/torify /usr/sbin/ngircd|g' /lib/systemd/system/ngircd.service
systemctl daemon-reload
systemctl start ngircd
fi
dialog --title $"IRC Server" \
--msgbox $"The IRC server can now be accessed via its onion address without SSL" 8 50
fi
}
function remove_user_from_mailing_list {
select_user
if [ ! $SELECTED_USERNAME ]; then
@ -1859,8 +1815,7 @@ function menu_irc {
--radiolist $"Choose an operation:" 14 70 4 \
1 $"Set a password for all IRC users" off \
2 $"Show current IRC login password" off \
3 $"Access via the onion address" off \
4 $"Exit" on 2> $data
3 $"Exit" on 2> $data
sel=$?
case $sel in
1) break;;
@ -1869,8 +1824,7 @@ function menu_irc {
case $(cat $data) in
1) irc_set_global_password;;
2) irc_show_password;;
3) irc_via_onion;;
4) break;;
3) break;;
esac
done
}