diff --git a/backup-image/intel-backlight-toggle.sh b/backup-image/intel-backlight-toggle.sh index e34c92d..f32c6e8 100755 --- a/backup-image/intel-backlight-toggle.sh +++ b/backup-image/intel-backlight-toggle.sh @@ -1,5 +1,10 @@ #!/bin/bash -echo -n "0" >> /sys/class/backlight/intel_backlight/brightness; -read; -echo -n "24000" >> /sys/class/backlight/intel_backlight/brightness; -exit 0; +if [ -f /sys/class/backlight/intel_backlight/brightness ]; then + pV=$(cat /sys/class/backlight/intel_backlight/brightness); + echo -n "0" >> /sys/class/backlight/intel_backlight/brightness; + read; + echo -n "$pV" >> /sys/class/backlight/intel_backlight/brightness; + exit 0; +else + exit 1; +fi