literal name_enable wherever possible, and ${name}_enable when it's not, to prepare for the demise of set_rcvar(). In cases where I had to hand-edit unusual instances also modify formatting slightly to be more uniform (and in some cases, correct). This includes adding some $FreeBSD$ tags, and most importantly moving rcvar= to right after name= so it's clear that one is derived from the other.
80 lines
2.2 KiB
Bash
80 lines
2.2 KiB
Bash
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: kannel_smsbox kannel_wapbox kannel_bearerbox
|
|
# REQUIRE: NETWORKING SERVERS
|
|
# BEFORE: LOGIN
|
|
# KEYWORD: shutdown
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=kannel
|
|
rcvar=kannel_enable
|
|
|
|
command="%%PREFIX%%/sbin/run_kannel_box"
|
|
extra_commands="reload"
|
|
sig_reload=SIGUSR1
|
|
|
|
load_rc_config $name
|
|
# Set defaults
|
|
kannel_config=${kannel_config:-"%%PREFIX%%/etc/kannel.conf"}
|
|
kannel_user=${kannel_user:-"kannel"}
|
|
# Config file is required
|
|
if [ ! -r ${kannel_config} ]; then
|
|
warn "${kannel_config} is not readable."
|
|
case $1 in
|
|
force*) : ;;
|
|
*) exit 1 ;;
|
|
esac
|
|
fi
|
|
|
|
if test -n ${kannel_enable:-""} && checkyesno kannel_enable; then
|
|
kannel_bearerbox_enable=${kannel_bearerbox_enable:-"YES"}
|
|
kannel_smsbox_enable=${kannel_smsbox_enable:-"YES"}
|
|
kannel_wapbox_enable=${kannel_wapbox_enable:-"YES"}
|
|
fi
|
|
|
|
# bearerbox
|
|
name=kannel_bearerbox
|
|
rcvar=kannel_bearerbox_enable
|
|
pidfile=/var/run/kannel/${name}.pid
|
|
# Defaults
|
|
kannel_bearerbox_user=${kannel_bearerbox_user:-"${kannel_user}"}
|
|
kannel_bearerbox_enable=${kannel_bearerbox_enable:-"NO"}
|
|
kannel_bearerbox_config=${kannel_bearerbox_config:-"${kannel_config}"}
|
|
kannel_bearerbox_flags=${kannel_bearerbox_flags:-"--pidfile ${pidfile} %%PREFIX%%/sbin/bearerbox ${kannel_bearerbox_flags} ${kannel_bearerbox_config}"}
|
|
#
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|
|
#
|
|
_rc_restart_done=false
|
|
|
|
# smsbox
|
|
name=kannel_smsbox
|
|
rcvar=kannel_smsbox_enable
|
|
pidfile=/var/run/kannel/${name}.pid
|
|
# Defaults
|
|
kannel_smsbox_user=${kannel_smsbox_user:-"${kannel_user}"}
|
|
kannel_smsbox_enable=${kannel_smsbox_enable:-"NO"}
|
|
kannel_smsbox_config=${kannel_smsbox_config:-"${kannel_config}"}
|
|
kannel_smsbox_flags=${kannel_smsbox_flags:-"--pidfile ${pidfile} %%PREFIX%%/sbin/smsbox ${kannel_smsbox_flags} ${kannel_smsbox_config}"}
|
|
#
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|
|
#
|
|
_rc_restart_done=false
|
|
|
|
# wapbox
|
|
name=kannel_wapbox
|
|
rcvar=kannel_wapbox_enable
|
|
pidfile=/var/run/kannel/${name}.pid
|
|
# Defaults
|
|
kannel_wapbox_user=${kannel_wapbox_user:-"${kannel_user}"}
|
|
kannel_wapbox_enable=${kannel_wapbox_enable:-"NO"}
|
|
kannel_wapbox_config=${kannel_wapbox_config:-"${kannel_config}"}
|
|
kannel_wapbox_flags=${kannel_wapbox_flags:-"--pidfile ${pidfile} %%PREFIX%%/sbin/wapbox ${kannel_wapbox_flags} ${kannel_wapbox_config}"}
|
|
#
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|
|
|