From 6f5bb61ae4e61d3b2ddaeae18c27c9d7a6798f0c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2016 14:00:06 +0100 Subject: [PATCH] Set users up with the current IRC password --- src/freedombone | 5 ++++- src/freedombone-adduser | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/freedombone b/src/freedombone index 2533a1a1..f2918806 100755 --- a/src/freedombone +++ b/src/freedombone @@ -7262,6 +7262,9 @@ function install_irc_client { echo ' use_ssl = "yes";' >> /home/$MY_USERNAME/.irssi/config echo ' ssl_verify = "no";' >> /home/$MY_USERNAME/.irssi/config echo ' autoconnect = "yes";' >> /home/$MY_USERNAME/.irssi/config + if [ $IRC_PASSWORD ]; then + echo " password = \"${IRC_PASSWORD}\";" >> /home/$MY_USERNAME/.irssi/config + fi echo ' }' >> /home/$MY_USERNAME/.irssi/config echo ');' >> /home/$MY_USERNAME/.irssi/config echo '' >> /home/$MY_USERNAME/.irssi/config @@ -10836,9 +10839,9 @@ install_tox_node install_tox_client tox_avahi configure_firewall_for_xmpp -install_irc_client install_irc_server configure_firewall_for_irc +install_irc_client install_voip install_sip update_sipwitch_daemon diff --git a/src/freedombone-adduser b/src/freedombone-adduser index 44eed563..cc0263a7 100755 --- a/src/freedombone-adduser +++ b/src/freedombone-adduser @@ -306,7 +306,11 @@ if grep -q "install_irc_client" $COMPLETION_FILE; then if grep -q "IRC_PORT" $CONFIGURATION_FILE; then IRC_PORT=$(grep "IRC_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') fi - + IRC_PASSWORD=$(cat /etc/ngircd/ngircd.conf | grep "Password =" | head -n 1 | awk -F '=' '{print $2}') + if [ ${#IRC_PASSWORD} -lt 2 ]; then + IRC_PASSWORD= + fi + if [ ! -d /home/$MY_USERNAME/.irssi ]; then mkdir /home/$MY_USERNAME/.irssi fi @@ -331,6 +335,7 @@ if grep -q "install_irc_client" $COMPLETION_FILE; then echo ' use_ssl = "yes";' >> /home/$MY_USERNAME/.irssi/config echo ' ssl_verify = "no";' >> /home/$MY_USERNAME/.irssi/config echo ' autoconnect = "yes";' >> /home/$MY_USERNAME/.irssi/config + echo ' }' >> /home/$MY_USERNAME/.irssi/config echo ');' >> /home/$MY_USERNAME/.irssi/config echo '' >> /home/$MY_USERNAME/.irssi/config