mirror of
https://github.com/openwrt/telephony.git
synced 2025-05-01 11:50:12 +08:00

The baresip init script is changed to use UCI instead of the debian style /etc/default basic service configuration. A uci-defaults script is added to create a basic UCI config: -- config baresip main option enable 0 option options '' -- With this change an issues is also resolved, on which the baresip service doesn't start due to the baresip user not being the owner of the /etc/baresip configuration directory. Additionally a reload_config trigger is added for baresip. Signed-off-by: Daniel Danzberger <dd@embedd.com>
29 lines
475 B
Bash
29 lines
475 B
Bash
#!/bin/sh /etc/rc.common
|
|
# Copyright (C) 2017 OpenWrt.org
|
|
|
|
START=92
|
|
USE_PROCD=1
|
|
PROG=/usr/bin/baresip
|
|
|
|
start_service()
|
|
{
|
|
local enable options
|
|
|
|
uci_validate_section baresip baresip main \
|
|
'enable:bool:0' \
|
|
'options:string'
|
|
|
|
[ "$enable" = "0" ] && return
|
|
|
|
procd_open_instance
|
|
procd_set_param command $PROG -f /etc/baresip $options
|
|
procd_set_param user baresip
|
|
procd_set_param respawn
|
|
procd_close_instance
|
|
}
|
|
|
|
service_triggers()
|
|
{
|
|
procd_add_reload_trigger baresip
|
|
}
|