stat(1): Fix -Wundef.
[dragonfly.git] / etc / rc.d / varsym
blob36f258bba4b870b3aacccbc030b297c786163335
1 #!/bin/sh
3 # PROVIDE: varsym
4 # REQUIRE: mountcritremote
6 . /etc/rc.subr
8 name=varsym
9 rcvar="varsym_enable"
10 required_files="/etc/varsym.conf"
11 start_cmd="varsym_start"
12 stop_cmd=":"
14 varsym_start()
16 local line
18 if [ ! -f "/etc/varsym.conf" ]; then
19 return
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 \#*|'')
27 *[^=\ ]=[^=\ ]*)
28 debug "varsym -s ${line}"
29 eval varsym -s ${line}
32 warn "invalid syntax: '${line}'"
34 esac
35 done < /etc/varsym.conf
38 load_rc_config $name
39 run_rc_command "$1"