Drop main() prototype. Syncs with NetBSD-8
[minix.git] / etc / rc.d / staticroute
blobc0804a3a99c02f2759ad3265239ae4389d13a4bc
1 #!/bin/sh
3 # $NetBSD: staticroute,v 1.6 2012/05/02 15:57:15 gendalia Exp $
6 # PROVIDE: staticroute
7 # REQUIRE: network
8 # BEFORE: NETWORKING
10 # See the route.conf(5) manual page for details.
12 $_rc_subr_loaded . /etc/rc.subr
14 name="staticroute"
15 start_cmd="staticroute_doit Adding add"
16 stop_cmd="staticroute_doit Deleting delete"
18 staticroute_doit() {
19 retval=0
21 if [ -s /etc/route.conf ]; then
22 echo "$1 static routes."
23 ( while read args; do
24 [ -z "$args" ] && continue
25 case "$args" in
26 "#"*)
28 "+"*)
29 if [ $2 = "add" ]; then
30 eval "${args#*+}" || retval=1
33 "-"*)
34 if [ $2 = "delete" ]; then
35 eval "${args#*-}" || retval=1
38 "!"*)
39 eval "${args#*!}" || retval=1
42 eval "route -q $2 -$args" || retval=1
44 esac
45 done < /etc/route.conf )
48 return $retval
51 load_rc_config $name
52 run_rc_command "$1"