Turning on/off output
I have unit named ARCO connected over USB to Tomato based ASUS router.
It is equipped in /bin/sh not in bash. The unit is equipped in 4 relay outputs. The command Code:
./arco Code:
./arco 2 I want to turn off/on particular output in pre-defined time. The part of program responsible for that looks like this: Code:
if [ "$czas" -gt "$out4_off" -o "$czas" -lt "$out4_on" ] Code:
czas - actual time in my time-zone Value of out4_on_1 is grater than out4_on and similar Value of out4_off_1 is grater than out4_off In case of my program, the first "if" will for example set output to ON, but the second "if" statement set it again to OFF. How can I modify the program above, to be sure that the result of first "if" statement will not be overwritten by second "if" and vice-versa. Any idea? |
Depending on what that shell actually is, you may have else-if support; something like this
Code:
if [ "$czas" -gt "$out4_off" -o "$czas" -lt "$out4_on" ] |
All times are GMT -5. The time now is 01:56 PM. |