[patch-team] - This adds support for channels in znc configuration - Signed-off-by: Timothy Redaelli <timothy at redaelli.eu>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@24218 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
dingo 2010-12-02 22:31:38 +00:00
parent 0854d2d7ce
commit 0b19bdd149
2 changed files with 11 additions and 0 deletions

View File

@ -8,6 +8,8 @@ config user 'sampleUser'
option altnick 'userSample'
option ident 'openwrt'
option realname 'John Doe'
# This adds support for channels in znc configuration:
# list channel '#chan optional_password'
# list of allowed servers
list server 'chat.freenode.net 6667'

View File

@ -10,6 +10,14 @@ add_param() {
echo "$1 = $2" >> $ZNC_CONFIG
}
add_chan() {
chan=${2% *}
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 @@ add_user() {
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
}