etc/services - sync with NetBSD-8
[minix.git] / etc / rc.d / rtadvd
blob5fe67720fda3b3c5c14f000478126198e157d9ae
1 #!/bin/sh
3 # $NetBSD: rtadvd,v 1.8 2013/07/09 09:34:58 roy Exp $
6 # PROVIDE: rtadvd
7 # REQUIRE: DAEMON
8 # BEFORE: LOGIN
10 $_rc_subr_loaded . /etc/rc.subr
12 name=rtadvd
13 rcvar=$name
14 command="/usr/sbin/$name"
15 pidfile="/var/run/$name.pid"
16 extra_commands=reload
17 start_precmd=rtadvd_prestart
18 reload_precmd=rtadvd_prereload
20 rtadvd_prereload()
22 local chdir="$(getent passwd _rtadvd | cut -d: -f6)"
23 local conf=/etc/rtadvd.conf myflags o confdir
25 [ -z "$chdir" -o "$chdir" = / ] && return 0
27 if [ -n "$flags" ]; then
28 myflags=$flags
29 else
30 eval myflags=\$${name}_flags
32 set -- ${myflags}
33 while getopts c:dDfM:Rs o; do
34 case "$1" in
35 -c) conf="$OPTARG";;
36 esac
37 shift
38 done
39 confdir=$(dirname "$conf")
41 echo "$name: copying $conf to $chdir$conf"
42 cp "$conf" "$chdir$conf"
44 # Provide a link to the chrooted dump file
45 ln -snf "$chdir/var/run/$name.dump" /var/run
48 rtadvd_prestart()
50 if [ "$ip6mode" != router ]; then
51 warn \
52 "${name} cannot be used on IPv6 host, only on an IPv6 router."
53 return 1
56 rtadvd_prereload
59 load_rc_config $name
60 run_rc_command "$1"