#!/bin/sh

. /etc/init.d/funcs/init-funcs
. /etc/init.d/funcs/colors.sh

case "$1" in
    start)
        printf "$BBLUE**$BYELLOW Starting networking\n$RESET"
        /sbin/ifup -a &> /dev/null
        check $? "networking"
        echo $! > /var/run/networking.pid
        ;;
    stop)
        printf "$BBLUE**$BYELLOW Stopping netowrking\n$RESET"
        /sbin/ifdown -a
        check $? "Stop networking"
        if [ -f /var/run/networking.pid ]; then
            rm /var/run/networking.pid
        fi
        ;;
    restart|reload)
        $0 stop
        $0 start
        ;;
    *)
        echo "$0 init script usage: $0 {start|stop|restart|reload}"
        return 1
esac
return $?
