I've created a bash script to allow my keyboard light to turn on at a certain time. I have however not been able to get it running. I have verified the 'light' command and it does work. I've also included echo statements to check if conditions are met but it seems they are skipped all together.
I do know the script is running successfully because i have plotted the output 'test' to a file and that command is written...
Does anyone have an idea what I am doing wrong ?
sorry for the noob question.....
#!/bin/bash
currenttime=$(date +%H:%M)
echo test
if [[ "$currenttime" > "17:00" ]]; then
if [[ "$currenttime" < "18:00" ]]; then
light -Srs "sysfs/leds/chromeos::kbd_backlight" 25
echo 1
fi
fi
if [[ "$currenttime" > "18:00" ]]; then
if [[ "$currenttime" < "19:00" ]]; then
light -Srs "sysfs/leds/chromeos::kbd_backlight" 50
echo 2
fi
fi
if [[ "$currenttime" > "19:00" ]]; then
if [[ "$currenttime" < "20:00" ]]; then
light -Srs "sysfs/leds/chromeos::kbd_backlight" 75
echo 3
fi
fi
if [[ "$currenttime" > "20:00" ]]; then
if [[ "$currenttime" < "06:00" ]]; then
light -Srs "sysfs/leds/chromeos::kbd_backlight" 100
echo 4
fi
fi
if [[ "$currenttime" < "07:00" ]]; then
if [[ "$currenttime" > "06:00" ]]; then
light -Srs "sysfs/leds/chromeos::kbd_backlight" 50
echo 5
fi
fi
if [[ "$currenttime" > "7:00" ]]; then
if [[ "$currenttime" < "17:00" ]]; then
light -Srs "sysfs/leds/chromeos::kbd_backlight" 0
echo 6
fi
fi