home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #
- # Start ethernet router (gateway - interface0)
-
- . /etc/colors
- . /etc/system.cfg
- . /etc/chat.pwd
- . /etc/live.cfg
-
- [ "$ROUTER" = ethernet ] || exit
- [ "$USEPPP0" = y ] && exit
-
- stp() { route del default 2>/dev/null; }
- str() {
- echo -n "Adding default route... "
- if [ "$USEDHCP0" = y -a ! -f /etc/dhcpc/dhcpcd-${INTNAME0}.info ]; then
- echo "${CR}Failed$CW /$CY Delayed$CW"
- exit
- fi
- [ "$GATEWAY" ] && a="gw $GATEWAY"
- route add default $a $INTNAME0
- = $? "Done $CC $GATEWAY$CW"
- }
-
- case "$1" in
- start) str;;
- stop) stp;;
- restart|newip) stp;str;;
- status) route -n | sed -n /default/P;;
- esac
-