From 5a7b501e507fa993724df07a948b13791289ffbe Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2016 09:55:15 +0100 Subject: [PATCH] Create an IRC login password This adds a little more security by default. The fact that any user of the box can read this password isn't a problem because it's expected that they should be able to do that. --- src/freedombone | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/freedombone b/src/freedombone index 876534c4..2533a1a1 100755 --- a/src/freedombone +++ b/src/freedombone @@ -7325,6 +7325,11 @@ function install_irc_server { DEFAULTDOMAIN="${DEFAULT_DOMAIN_NAME}.local" fi + # create a login password if needed + if [ ! $IRC_PASSWORD ]; then + IRC_PASSWORD="$(openssl rand -base64 32 | cut -c1-10)" + fi + echo '**************************************************' > /etc/ngircd/motd echo $'* F R E E D O M B O N E I R C *' >> /etc/ngircd/motd echo '* *' >> /etc/ngircd/motd @@ -7363,7 +7368,7 @@ function install_irc_server { sed -i "s/;Password = ThePwd/Password = $IRC_OPERATOR_PASSWORD/g" /etc/ngircd/ngircd.conf sed -i 's|;Listen =.*|Listen = 0.0.0.0,0.0.0.0:9050,127.0.0.1,127.0.0.1:9050|g' /etc/ngircd/ngircd.conf if [ $IRC_PASSWORD ]; then - sed -i "0,/RE/s/Password =.*/Password = $IRC_PASSWORD/" /etc/ngircd/ngircd.conf + sed -i "0,/RE/s/Password =.*/Password =$IRC_PASSWORD/" /etc/ngircd/ngircd.conf fi # If we are on a mesh then DNS is not available if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then