Browse Source

znc: Add support for many configurable listeners for znc

Function add_listener called from /etc/init.d/znc, but not implemented

Signed-off-by: Pavel Demkovich <finn@finnix.servebeer.com>
lilik-openwrt-22.03
Pavel Demkovich 4 years ago
parent
commit
dd586837e8
2 changed files with 43 additions and 4 deletions
  1. +11
    -3
      net/znc/files/znc.conf
  2. +32
    -1
      net/znc/files/znc.init

+ 11
- 3
net/znc/files/znc.conf View File

@ -1,7 +1,5 @@
config znc
# where to listen for connections
list listener '192.168.1.1 1234'
# If using SSL sockets, use the following certifcate:
# If using SSL sockets, use the following certificate:
# option znc_ssl_cert '/etc/znc.cert'
# load global modules (You need to install them first):
@ -10,6 +8,16 @@ config znc
# remove this to enable the service
option disabled 1
config listener 'sampleListener'
option allowirc 'true'
option allowweb 'false'
option host '192.168.1.1'
option port '1234'
option ipv4 'true'
option ipv6 'false'
# you must set option_ssl_cert in znc section before change
option ssl 'false'
config user 'sampleUser'
# Use either a plain text password or use the full sha256#... line.
# You can generate one with 'znc -s'.


+ 32
- 1
net/znc/files/znc.init View File

@ -71,7 +71,7 @@ znc_global() {
mkdir -p $ZNC_CONFIG_PATH/configs/
[ ! -f "$ZNC_CONFIG" ] || rm "$ZNC_CONFIG"
add_param "Version" "1.0"
add_param "Version" "1.6"
config_get anoniplimit "$znc" anoniplimit
config_get maxbuffersize "$znc" maxbuffersize
@ -93,6 +93,37 @@ znc_global() {
fi
}
add_listener() {
local listener="$1"
local host
local port
local allowirc
local allowweb
local ipv4
local ipv6
local ssl
config_get host "$listener" host
config_get port "$listener" port
config_get allowirc "$listener" allowirc
config_get allowweb "$listener" allowweb
config_get ipv4 "$listener" ipv4
config_get ipv6 "$listener" ipv6
config_get ssl "$listener" ssl
echo "<Listener $listener>" >> $ZNC_CONFIG
[ -z "$host" ] || add_param " Host" "$host"
[ -z "$port" ] || add_param " Port" "$port"
[ -z "$allowirc" ] || add_param " AllowIRC" "$allowirc"
[ -z "$allowweb" ] || add_param " AllowWeb" "$allowweb"
[ -z "$ipv4" ] || add_param " IPv4" "$ipv4"
[ -z "$ipv6" ] || add_param " IPv6" "$ipv6"
[ -z "$ssl" ] || add_param " SSL" "$ssl"
echo "</Listener>" >> $ZNC_CONFIG
}
add_user() {
local user="$1"
local password


Loading…
Cancel
Save