飞凌嵌入式
backlight.sh:
- #! /bin/bash
- echo -e "\033[36m-----------BACKLIGHT--------------\033[0m"
- echo -e "\033[1;32mPress Esc to turn off the backlight\033[0m"
- ./continue.sh
- echo 0 > /sys/class/backlight/backlight/brightness
- echo -e "\033[1;32mPress Esc to turn on the backlight\033[0m"
- ./continue.sh
- echo 6 > /sys/class/backlight/backlight/brightness
- echo "Please enter y/n"
- read -sn 1 read_check
- if [ ! -n $read_check ]
- then
- exit 0
- elif [ "$read_check" = "y" ]
- then
- echo -e "\033[1;32mBACKLIGHT OK\033[0m"
- else
- echo -e "\033[1;31mBACKLIGHT ERR\033[0m"
- fi
- root@ELF1:~# chmod 777 backlight.sh
- root@ELF1:~# ./backlight.sh
更多回帖