#!/bin/sh
# post-atalkd.ini
#
# AppleTalk routing between internal networks

. /etc/config

ATALK_ZONE="Homebase"
ATALK_ZONE2="Kaospilot"
ATALK_ZONE3="Kaosman"
ATALK_ZONE4="Kaospilot"
ATALK_ZONE5="Frontrunners"

if [ ${INSIDE2_DEV} ]; then
	echo "${INSIDE2_DEV} -seed -phase 2 -net 1200-1201 -addr 1200.50 -zone \"${ATALK_ZONE2}\"" >> /etc/atalkd.conf
	[ ${INSIDE3_DEV} ] && echo "${INSIDE3_DEV} -seed -phase 2 -net 1300-1301 -addr 1300.50 -zone \"${ATALK_ZONE3}\"" >> /etc/atalkd.conf
	[ ${INSIDE4_DEV} ] && echo "${INSIDE4_DEV} -seed -phase 2 -net 1400-1401 -addr 1400.50 -zone \"${ATALK_ZONE4}\"" >> /etc/atalkd.conf
	[ ${INSIDE5_DEV} ] && echo "${INSIDE5_DEV} -seed -phase 2 -net 1500-1501 -addr 1500.50 -zone \"${ATALK_ZONE5}\"" >> /etc/atalkd.conf
	echo "${INSIDE_DEV} -seed -phase 2 -net 1100-1101 -addr 1100.50 -zone \"${ATALK_ZONE}\"" >> /etc/atalkd.conf
else
	echo "${INSIDE_DEV} -router -phase 2 -net 1100-1101 -addr 1100.50 -zone \"${ATALK_ZONE}\"" >> /etc/atalkd.conf
fi

# Temporary hack - too lazy to recompile with the right one builtin...
[ -d /var/lock ] || ln -s run /var/lock

/bin/atalkd -f /etc/atalkd.conf
