Sfoglia il codice sorgente

Optional IRC password

Bob Mottram 9 anni fa
parent
commit
b2084b8dc7
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9
    0
      src/freedombone

+ 9
- 0
src/freedombone Vedi File

85
 SSH_PORT=2222
85
 SSH_PORT=2222
86
 IRC_PORT=6697
86
 IRC_PORT=6697
87
 
87
 
88
+# An optional password to log into IRC. This applies to all users
89
+IRC_PASSWORD=
90
+
88
 # If this file exists it contains a global password used with
91
 # If this file exists it contains a global password used with
89
 # disk image installs. This simplifies password management for
92
 # disk image installs. This simplifies password management for
90
 # deployment at scale
93
 # deployment at scale
868
       if [[ $CONFIGURATION_FILE != '/root/freedombone.cfg' ]]; then
871
       if [[ $CONFIGURATION_FILE != '/root/freedombone.cfg' ]]; then
869
           cp $CONFIGURATION_FILE /root/freedombone.cfg
872
           cp $CONFIGURATION_FILE /root/freedombone.cfg
870
       fi
873
       fi
874
+      if grep -q "IRC_PASSWORD" $CONFIGURATION_FILE; then
875
+          IRC_PASSWORD=$(grep "IRC_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
876
+      fi
871
       if grep -q "DEFAULT_LANGUAGE" $CONFIGURATION_FILE; then
877
       if grep -q "DEFAULT_LANGUAGE" $CONFIGURATION_FILE; then
872
           DEFAULT_LANGUAGE=$(grep "DEFAULT_LANGUAGE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
878
           DEFAULT_LANGUAGE=$(grep "DEFAULT_LANGUAGE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
873
       fi
879
       fi
6689
   sed -i 's/;RequireAuthPing = no/RequireAuthPing = no/g' /etc/ngircd/ngircd.conf
6695
   sed -i 's/;RequireAuthPing = no/RequireAuthPing = no/g' /etc/ngircd/ngircd.conf
6690
   sed -i "s/;Name = TheOper/Name = $MY_USERNAME/g" /etc/ngircd/ngircd.conf
6696
   sed -i "s/;Name = TheOper/Name = $MY_USERNAME/g" /etc/ngircd/ngircd.conf
6691
   sed -i "s/;Password = ThePwd/Password = $IRC_OPERATOR_PASSWORD/g" /etc/ngircd/ngircd.conf
6697
   sed -i "s/;Password = ThePwd/Password = $IRC_OPERATOR_PASSWORD/g" /etc/ngircd/ngircd.conf
6698
+  if [ $IRC_PASSWORD ]; then
6699
+      sed -i "0,/RE/s/Password =.*/Password = $IRC_PASSWORD/" /etc/ngircd/ngircd.conf
6700
+  fi
6692
   # If we are on a mesh then DNS is not available
6701
   # If we are on a mesh then DNS is not available
6693
   if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
6702
   if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
6694
       sed -i "s/;DNS =.*/DNS = no/g" /etc/ngircd/ngircd.conf
6703
       sed -i "s/;DNS =.*/DNS = no/g" /etc/ngircd/ngircd.conf