mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
voice_client: delete non-existing lines from config
This commit is contained in:
parent
d6ab9d1a12
commit
a1d6b02a20
1 changed files with 16 additions and 2 deletions
|
|
@ -2001,7 +2001,18 @@ done
|
|||
#
|
||||
set_line_name()
|
||||
{
|
||||
local curname name_ix ix item
|
||||
local maxlinenum=$2
|
||||
local curname name_ix ix item lnum
|
||||
|
||||
# delete non-existing lines from config #
|
||||
case $1 in
|
||||
brcm[0-9])
|
||||
lnum=${1:4:1}
|
||||
[ $((lnum+1)) -gt $maxlinenum ] && uci -q delete voice_client.$1
|
||||
;;
|
||||
esac
|
||||
#########################################
|
||||
|
||||
config_get curname $1 name
|
||||
[ -n "$curname" ] && return
|
||||
|
||||
|
|
@ -2072,13 +2083,16 @@ start_service() {
|
|||
run_hook preinit
|
||||
mkdir -p $WORKDIR
|
||||
mkdir -p $WORKDIR/ssl
|
||||
|
||||
# Load config file
|
||||
config_load voice_client
|
||||
|
||||
########################################################
|
||||
# Set line names according to whats reported by brcminfo
|
||||
# and delete non-existing lines from voice_client config
|
||||
########################################################
|
||||
config_foreach set_line_name brcm_line
|
||||
local maxlinenum=$(db get hw.board.VoicePorts)
|
||||
config_foreach set_line_name brcm_line $maxlinenum
|
||||
uci_commit voice_client
|
||||
|
||||
#######################################
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue