CRUX : Home

Home :: Documentation :: Download :: Development :: Community :: Wiki :: Ports :: Bugs :: Links :: About

Back to wiki start page

Categories: Network

Automatically configure hotpluggable network devices

Author

Johannes Winkelmann

Description

Provide hooks to configure a device automatically when it's plugged in.

Instructions

Quick guide

Example handler for a device called 'usb0'

#!/bin/sh
#
# /etc/rc.d/net.usb0: start/stop network
#

case $1 in
start)
        /sbin/ifconfig usb0 192.168.1.50 netmask 255.255.255.0
        ;;
stop)
        /sbin/ifconfig usb0 down
        ;;
restart)
        $0 stop
        $0 start
        ;;
*)
        echo "usage: $0 [start|stop|restart]"
        ;;
esac

# End of file