Files
telephony/net/baresip/files/baresip.init
Sebastian Kemper 83c0aef587 baresip: use return in init script
"start_service()" is a function, hence "return" should be used instead
of "exit".

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
(cherry picked from commit b69ae7b934)
Signed-off-by: Richard Muzik <richard.muzik@nic.cz>
2024-06-26 07:34:27 +02:00

40 lines
791 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2017 OpenWrt.org
START=92
USE_PROCD=1
#PROCD_DEBUG=1
DAEMON=baresip
DEFAULT=/etc/default/$DAEMON
LOGGER="/usr/bin/logger -p user.err -s -t $DAEMON"
OPTIONS=
PROG=/usr/bin/$DAEMON
[ -f $DEFAULT ] && . $DEFAULT
start_service() {
local dir=
if [ "$ENABLE_BARESIP" != yes ]; then
$LOGGER User configuration incomplete - not starting $DAEMON
$LOGGER Check ENABLE_BARESIP in $DEFAULT
return 1
fi
procd_open_instance
procd_set_param command $PROG
procd_append_param command \
-f /etc/$DAEMON \
$OPTIONS
procd_set_param pidfile /var/run/${DAEMON}.pid
# forward stderr to logd
procd_set_param stderr 1
# forward stdout to logd
#procd_set_param stdout 1
procd_set_param user $DAEMON
procd_close_instance
}