#!/bin/sh /etc/rc.common # # /etc/init.d/defaultled # # Script to set the LEDs to default states following (re)boot # where 'default' is white/orange on (0v) (no feeding requested) # and dmz on (0v) (cutout not activated therefore feeding allowed). # This script, when activated with '/etc/init.d/defaultled enable' will # create a symlink in /etc/rc.d/ (called S96defaultled) to this script # and thus will be executed right near the end of the boot process. # Also see my modified /etc/init.d/nvram (symlinked from /etc/rc.d/S02nvram) # which sets the white/orange LEDs on (0v) and DMZ off (3.3v) (i.e. feeding # disabled) as soon as possible during the boot process (about 4 secs in) # because the boot process causes the feeder to run until the S96defaultled # script is run. Both scripts (/etc/rc.d/S02nvram and /etc/rc.dS96defaultled) # are required because other system-provided scripts mess with the LEDs in # the interim stages so the idea is that we get in early to disable feeding, # let the router do its stuff, then set the LEDs to what we want (feeding # enabled but not requested) waiting for further instruction. START=96 start() { # Set the desired LED states (feeding allowed but not requested) echo '1' > /proc/diag/led/dmz echo '1' > /proc/diag/led/ses_white echo '1' > /proc/diag/led/ses_orange # Also set the system clock whilst we're at it # (Mainly for the logs (using 'logread'), and requires ntpdate installing) ntpdate ntp.newtonnet.co.uk }