View | Details | Raw Unified | Return to bug 134768
Collapse All | Expand All

(-)ports/net/tac_plus4/files/tac_plus.in (-7 / +80 lines)
Lines 2-19 Link Here
2
#
2
#
3
# $FreeBSD: ports/net/tac_plus4/files/tac_plus.in,v 1.1 2006/10/31 02:42:33 marcus Exp $
3
# $FreeBSD: ports/net/tac_plus4/files/tac_plus.in,v 1.1 2006/10/31 02:42:33 marcus Exp $
4
#
4
#
5
5
# PROVIDE: tac_plus
6
# PROVIDE: tac_plus
6
# REQUIRE: DAEMON
7
# REQUIRE: DAEMON
8
7
#
9
#
8
# Add the following line to /etc/rc.conf to enable the TACACS+ daemon:
10
# Add the following line to /etc/rc.conf to enable the TACACS+ daemon:
9
#
11
#
10
# tac_plus_enable="YES"
12
# tac_plus_enable (bool):    Set to "NO" by default
11
#
13
#    Set it to "YES" to enable tac_plus
12
14
# tac_plus_flags (str):      Set to "" by default
13
tac_plus_enable=${tac_plus_enable-"NO"}
15
#    Extra flags to be passed to start command
14
tac_plus_flags=${tac_plus_flags-"-C %%PREFIX%%/etc/tac_plus.conf"}
16
# tac_plus_profiles (str):   Set to "" by default
15
17
#    Allows you to run multiple tac_plus daemons with 
16
. %%RC_SUBR%%
18
#    different settings
19
# tac_plus_configfile (str): Set to "%%PREFIX%%/etc/tac_plus.conf" by default
20
#    Allows you to specify a different config file for
21
#    the tac_plus daemon
22
. %%RC_SUBR%%
17
23
18
name=tac_plus
24
name=tac_plus
19
rcvar=`set_rcvar`
25
rcvar=`set_rcvar`
Lines 21-25 Link Here
21
command="%%PREFIX%%/bin/tac_plus"
27
command="%%PREFIX%%/bin/tac_plus"
22
pidfile="/var/run/${name}.pid"
28
pidfile="/var/run/${name}.pid"
23
29
30
tac_plus_enable=${tac_plus_enable:-"NO"}
31
tac_plus_flags=${tac_plus_flags:-}
32
tac_plus_profiles=${tac_plus_profiles:-}
33
tac_plus_configfile=${tac_plus_configfile:-"%%PREFIX%%/etc/tac_plus.conf"}
34
24
load_rc_config ${name}
35
load_rc_config ${name}
36
37
if [ -n "$2" ]; then
38
	profile="$2"
39
	if [ "x${tac_plus_profiles}" != "x" ]; then
40
		eval tac_plus_configfile="\${tac_plus_${profile}_configfile:-}"
41
		if [ "x${tac_plus_configfile}" = "x" ]; then
42
			echo "You must define a configuration file (tac_plus_${profile}_configfile)"
43
			exit 1
44
		fi
45
		required_files="${tac_plus_configfile}"
46
		eval tac_plus_enable="\${tac_plus_${profile}_enable:-${tac_plus_enable}}"
47
		eval tac_plus_flags="\${tac_plus_${profile}_flags:-${tac_plus_flags}}"
48
		eval tac_plus_port="\${tac_plus_${profile}_port:-}"
49
		eval tac_plus_ip="\${tac_plus_${profile}_ip:-}"
50
	else
51
		echo "$0: extra argument ignored"
52
	fi
53
else
54
	if [ "x${tac_plus_profiles}" != "x" -a "x$1" != "x" ]; then
55
		for profile in ${tac_plus_profiles}; do
56
			eval _enable="\${tac_plus_${profile}_enable}"
57
			case "x${_enable:-${tac_plus_enable}}" in
58
				x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee])
59
					continue
60
					;;
61
				x[Yy][Ee][Ss])
62
					;;
63
				*)
64
					if test -z "$_enable"; then
65
						_var=tac_plus_enable
66
					else
67
						_var=tac_plus_"${profile}"_enable
68
					fi
69
					echo "Bad value "\
70
						"'${_enable:-${tac_plus_enable}}' "\
71
						"for ${_var}.  "\
72
						"Profile ${profile} skipped."
73
					continue
74
			esac
75
			echo "====> tac_plus profile: ${profile}"
76
			%%PREFIX%%/etc/rc.d/tac_plus $1 ${profile}
77
			retcode="$?"
78
			if [ "0${retcode}" -ne 0 ]; then
79
				failed="${profile} (${retcode}) ${failed:-}"
80
			else
81
				success="${profile} ${success:-}"
82
			fi
83
		done
84
		exit 0
85
	fi
86
fi
87
88
tac_plus_flags="-C ${tac_plus_configfile} ${tac_plus_flags}"
89
if [ "x${tac_plus_ip}" != "x" ]; then
90
	pidfile="${pidfile}.${tac_plus_ip}"
91
	tac_plus_flags="${tac_plus_flags} -B ${tac_plus_ip}"
92
fi
93
if [ "x${tac_plus_port}" != "x" ]; then
94
	pidfile="${pidfile}.${tac_plus_port}"
95
	tac_plus_flags="${tac_plus_flags} -p ${tac_plus_port}"
96
fi
97
25
run_rc_command "$1"
98
run_rc_command "$1"

Return to bug 134768