Milí majitelé routerů Turris,
toto fórum bylo 9. 12. 2016 zmrazeno a nahrazeno naším novým Turris fórem. Ještě chvíli bude dostupné k prohlížení, ale již zde není možné přispívat. Více informací naleznete v oznámení o uzavření fóra.
Dear Turris routers users,
this forum has been frozen on Dec 9th, 2016 and replaced by our new Turris forum. It will be read-only accessible for some time after. For more information, read the announcement about closing the forum.
#!/bin/sh
StdIntensity=`grep 'DEFAULT' /root/config/rainbow.conf | awk '{ print $2 }'`
StartH=`grep 'HIGH' /root/config/rainbow.conf | awk '{ print $2 }'`
StartM=`grep 'MED' /root/config/rainbow.conf | awk '{ print $2 }'`
StartL=`grep 'LOW' /root/config/rainbow.conf | awk '{ print $2 }'`
StopH=`grep 'HIGH' /root/config/rainbow.conf | awk '{ print $3 }'`
StopM=`grep 'MED' /root/config/rainbow.conf | awk '{ print $3 }'`
StopL=`grep 'LOW' /root/config/rainbow.conf | awk '{ print $3 }'`
IntH=`grep 'HIGH' /root/config/rainbow.conf | awk '{ print $4 }'`
IntM=`grep 'MED' /root/config/rainbow.conf | awk '{ print $4 }'`
IntL=`grep 'LOW' /root/config/rainbow.conf | awk '{ print $4 }'`
Program='/usr/bin/rainbow intensity '
DTH=`date +%H`
# Get actual intensity
ACT_INTENSITY=$(rainbow get intensity)
To_Intensity=$StdIntensity
if [ $DTH -ge $StartH ] ; then To_Intensity=$IntH ; fi ;
if [ $DTH -ge $StartM ] ; then To_Intensity=$IntM ; fi ;
if [ $DTH -ge $StartL ] ; then To_Intensity=$IntL ; fi ;
if [ $DTH -le $StopH ] ; then To_Intensity=$IntH ; fi ;
if [ $DTH -le $StopM ] ; then To_Intensity=$IntM ; fi ;
if [ $DTH -le $StopL ] ; then To_Intensity=$IntL ; fi ;
if [ $ACT_INTENSITY -ne $To_Intensity ]
then
$Program $To_Intensity
fi
k tomu tabulka s časy a intenzitami
DEFAULT 0
##Name From To Intensity
HIGH 19 7 1
MED 21 6 2
LOW 23 5 3
MAILTO=""
0 * * * * root /root/sh/rainbow_set.sh
Powered by mwForum 2.29.3 © 1999-2013 Markus Wichitill