#!/bin/sh
cd /
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
echo "starting"
mount -t tmpfs tmpfs /tmp
mount -t procfs procfs /proc
mount -t kernfs kernfs /sys
mount -t tmpfs -o union tmpfs /rtr
modload compat_linux
sysctl -w net.inet6.ip6.auto_linklocal=0

cd /rtr/
ifconfig -a > /rtr/hwdet.eth
echo "/dev/tty00: " > /rtr/hwdet.ser

/java/bin/java -jar /rtr/rtr.jar test hwdet path /rtr/ iface bsd line raw busywait java /java/bin/
chmod 755 /rtr/*.sh
sh /rtr/hwdet-all.sh
while (true); do
  sleep 1
  done
exit 0
