1#!/bin/sh 2# 3# $NetBSD: routed,v 1.7 2002/03/22 04:34:00 thorpej Exp $ 4# $FreeBSD: src/etc/rc.d/routed,v 1.6 2003/06/29 05:15:57 mtm Exp $ 5# $DragonFly: src/etc/rc.d/routed,v 1.1 2003/07/24 06:35:37 dillon Exp $ 6# 7 8# PROVIDE: routed 9# REQUIRE: netif routing 10# KEYWORD: DragonFly FreeBSD NetBSD 11 12. /etc/rc.subr 13 14name="routed" 15 16# XXX - Executable may be in a different location. The $name variable 17# is different from the variable in rc.conf(5) so the 18# subroutines in rc.subr won't catch it. 19# 20load_rc_config $name 21 22case ${OSTYPE} in 23DragonFly) 24 rcvar="router_enable" 25 command="${router:-/sbin/${name}}" 26 eval ${name}_flags=${router_flags} 27 start_precmd= 28 ;; 29 30 31FreeBSD) 32 rcvar="router_enable" 33 command="${router:-/sbin/${name}}" 34 eval ${name}_flags=${router_flags} 35 start_precmd= 36 ;; 37NetBSD) 38 rcvar=${name} 39 command="/sbin/${name}" 40 start_precmd="routed_precmd" 41 ;; 42esac 43 44routed_precmd() 45{ 46 if checkyesno gated && checkyesno routed; then 47 warn "gated and routed both requested to be run: only running gated." 48 return 1 49 fi 50} 51 52run_rc_command "$1" 53