› Forums › Network Management › ZeroShell › [Alix 2] Basic working solution to drive the front LEDs
- This topic is empty.
Viewing 1 post (of 1 total)
-
AuthorPosts
-
August 19, 2015 at 7:34 pm #44361
PatrickB
MemberHello.
Sorry I still have no solution to make a front LED of the Alix show the network activity. π₯
But I could find a little program with some features and doctor it to provide the basic functions. This script is self-explanatory.
I did not implement the CPU and disk activity, it would be easy to add. But my LED #2 is reserved for WAN activity, when I can do it… π
# set-alix-led.include.sh
#
# This script can be included by any script having to drive a LED on a Alix system.
#
# It relies on the very limited possibilities of the operator alix-leds that can be
# found there: http://linux.1wt.eu/alix/util/
# - the executable can be found in alix-leds-3.0-flx0.1-i386.tgz,
# - the source file can be found in alix-leds-3.0.tgz (for real functionalities).
#
# Arguments:
#
# $1 = 1|2|3 (actually not verified, if you want to play, have fun...)
# = the LED to operate. LED #1 is the leftmost, normally it is permanently lit on Alix.
# $2 = on|off|slow|fast
# = what to do: switch on, off or set to blinking slow or fast.
ZtNicAlwaysUp="ETH01"
ZtNicNotExisting="ETH666"
SetLed() # $1 = 1|2|3, $2 = on|off|slow|fast
{
# Here is all what I can do with that poor operator 'alix-leds':
# - start monitor an existing/unexisting NIC to tun the LED on/off,
# - immediately kill the process become useless :-(
# - for slow|fast blinking the process must remain,
# - so it has to be killed first before any change.
ZtPidFile="/tmp/SetLed$1.pid"
if [ -f $ZtPidFile ]; then
kill $(cat $ZtPidFile) ;
rm -rf $ZtPidFile ;
fi
case "$2" in
on)
alix-leds -l $1 -i $ZtNicAlwaysUp -p $ZtPidFile ;
kill $(cat $ZtPidFile) ;
rm -rf $ZtPidFile ;
;;
off)
alix-leds -l $1 -i $ZtNicNotExisting -p $ZtPidFile ;
kill $(cat $ZtPidFile) ;
rm -rf $ZtPidFile ;
;;
slow)
alix-leds -l $1 -r -p $ZtPidFile ;
;;
fast)
alix-leds -l $1 -R -p $ZtPidFile ;
;;
*)
echo -e "set-alix-led.include.sh: SetLed( $1, $2) not implemented.n"
;;
esac
}
The URL clickable: http://linux.1wt.eu/alix/util/
See also this topic: https://www.zeroshell.org/forum/viewtopic.php?t=743 π
Now I use this script in my project [Janus / twin Alix2] and it works very fine. π
Hope it can help.
. -
AuthorPosts
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.