freebsd-ports/net/lvwimax/files/lvwimax.in
Doug Barton 29813d5397 Remove painful examples of foo="", with particular prejudice against
constructions that parse out to [ -z "$foo" ] && foo=""

These are bad examples that get copied and pasted into new code, so the
hope is that with less bad examples there will be less need for me to
bring this up in review.

In a few of these files all that were changed were comments so that next
time I search for these patterns I won't trip on the file for no reason.

In a few places, add $FreeBSD$

No functional changes, so no PORTREVISION bumps
2011-05-15 02:49:17 +00:00

50 lines
940 B
Bash

#!/bin/sh
# $FreeBSD$
#
# PROVIDE: lvwimax
# REQUIRE: DAEMON
#
# Add the following line to /etc/rc.conf[.local] to enable lvwimax:
#
# lvwimax_enable="YES"
# lvwimax_mac_address="XX:XX:XX:XX:XX:XX", default is "00:00:00:00:00:00"
#
# XXX: tap0 interface is hardcoded at the driver
lvwimax_tap_dev="tap0"
. /etc/rc.subr
name=lvwimax
rcvar=${name}_enable
load_rc_config $name
lvwimax_enable=${lvwimax_enable-"NO"}
lvwimax_mac_address=${lvwimax_mac_address-"00:00:00:00:00:00"}
command=%%PREFIX%%/sbin/${name}
start_precmd="lvwimax_prestart"
start_postcmd="lvwimax_poststart"
stop_postcmd="lvwimax_poststop"
lvwimax_prestart()
{
ifconfig ${lvwimax_tap_dev} create
ifconfig ${lvwimax_tap_dev} mtu 1386
ifconfig ${lvwimax_tap_dev} ether ${lvwimax_mac_address}
ifconfig ${lvwimax_tap_dev} up
}
lvwimax_poststart()
{
dhclient ${lvwimax_tap_dev}
}
lvwimax_poststop()
{
ifconfig ${lvwimax_tap_dev} destroy
}
run_rc_command $1