http://www.switchfin.org/index.p ... &Itemid=54#p804
A simple script to make the SYS LED Blink
Sys Led
Hello, this is a function to make blink SYS Led
Usefull anouncing asterisk status. or any other stuff
no "leds" pakage needed
FileName [sysled_blink.sh]- #!/bin/hush
- STATE1=$1
- STATE1_udelay=$2
- STATE2=$3
- STATE2_udelay=$4
- times=$5
- while [ $times -gt 0 ]
- do
- echo $STATE1 > /proc/sys_led
- usleep $STATE1_udelay
- echo $STATE2 > /proc/sys_led
- usleep $STATE2_udelay
- times=`expr $times - 1`
- done;
複製代碼 USE:
>/somewhere/sysled_blink.sh 1 100000 0 300000 4
sysled_blink.sh FState FUdelay SState SUdelay Times
FState 1 first state - state 1-on 0-off
FUdelay 100000 number of u-seconds to sleep for first state
SState 0 second state - state 1-on 0-off
SUdelay 300000 number of u-seconds to sleep for second state
Times 4 times of blinking |