Update 2023-11-28 22:25 OpenBSD/amd64-x13

This commit is contained in:
c0dev0id 2023-11-28 22:25:57 +01:00
parent c91ec73306
commit 241adee410

35
.bin/obsd-route Executable file
View File

@ -0,0 +1,35 @@
#!/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