xref: /dragonfly/etc/rc.d/varsym (revision 6a3cbbc2)
1#!/bin/sh
2
3# PROVIDE: varsym
4# REQUIRE: mountcritremote
5
6. /etc/rc.subr
7
8name=varsym
9rcvar="varsym_enable"
10required_files="/etc/varsym.conf"
11start_cmd="varsym_start"
12stop_cmd=":"
13
14varsym_start()
15{
16	local line
17
18	if [ ! -f "/etc/varsym.conf" ]; then
19		return
20	fi
21
22	# NOTE: Do not miss the last line when it does not end with a LF.
23	while read -r line || [ -n "${line}" ]; do
24		case ${line} in
25		\#*|'')
26			;;
27		*[^=\ ]=[^=\ ]*)
28			debug "varsym -s ${line}"
29			eval varsym -s ${line}
30			;;
31		*)
32			warn "invalid syntax: '${line}'"
33			;;
34		esac
35	done < /etc/varsym.conf
36}
37
38load_rc_config $name
39run_rc_command "$1"
40