This adds support for channels in znc configuration:

Just put a "list channel    '#chan optional_password'" in an user section of 
/etc/config/znc

Signed-off-by: Timothy Redaelli <timo...@redaelli.eu>

---

Index: net/znc/files/znc.init
===================================================================
--- net/znc/files/znc.init      (revisione 24213)
+++ net/znc/files/znc.init      (copia locale)
@@ -10,6 +10,14 @@
        echo "$1 = $2" >> $ZNC_CONFIG
 }
 
+add_chan() {
+       chan=${1% *}
+       pass=${1#* }
+       echo "  <Chan $chan>" >> $ZNC_CONFIG
+       [ "$chan" != "$pass" ] && echo "                Key = $pass" >> 
$ZNC_CONFIG
+       echo "  </Chan>" >> $ZNC_CONFIG
+}
+
 znc_global() {
        local znc="$1"
        local anoniplimit
@@ -72,6 +80,7 @@
 
        config_list_foreach "$user" server "add_param \"        Server\""
        config_list_foreach "$user" module "add_param \"        LoadModule\""
+       config_list_foreach "$user" channel "add_chan"
        echo "</User>" >> $ZNC_CONFIG
 }
 
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to