#!/bin/sh [ $(id -u) -ne 0 ] && echo "root?" && exit 0 usage() { echo "obsd-route [start,stop]" exit 0 } do_start() { set -x sysctl net.inet.ip.forwarding=1 ifconfig trunk0 destroy ifconfig iwx0 inet autoconf ifconfig re0 inet 192.168.23.1 netmask 255.255.255.0 rcctl enable dhcpd rcctl set dhcpd flags re0 rcctl start dhcpd } do_stop() { set -x sysctl net.inet.ip.forwarding=0 ifconfig iwx0 -inet ifconfig re0 -inet rcctl stop dhcpd rcctl disable dhcpd sh /etc/netstart } case $1 in start) do_start; ;; stop) do_stop; ;; *) usage; esac