#! /bin/sh

. "`dirname $0`/rcdefs"

PATH=${PATH_SYS}

case "$1" in
  start)
    if [ -n "${IPX_NETWORK}" ]
    then
      Print -n "Starting IPX networking... "
      ModuleInsert ipx

      [ -n "${IPX_NETWORK}" ] && ipx_interface add -p ${IPX_INTERFACE} \
        ${IPX_FRAME} ${IPX_NETWORK}
      [ -n "${IPX_NETWORK}" ] && ipx_route add ${IPX_NETWORK} \
        ${IPX_ROUTER_NETWORK} ${IPX_ROUTER_HW_ADDRESS}
      Print "done."
    fi
    ;;
  stop)
    if [ -n "${IPX_NETWORK}" ]
    then
      Print -n "Stopping IPX networking... "
      [ -n "${IPX_NETWORK}" ] && ipx_route del ${IPX_NETWORK}
      [ -n "${IPX_NETWORK}" ] && ipx_interface delall

      ModuleRemove ipx
      Print "done."
    fi
    ;;
  *)
    Usage "$0"
    exit 1
esac

exit 0
