TERES/SOFTWARE/A64-TERES/teres1-debug/debug_switch.sh
2018-05-04 08:16:49 +03:00

20 lines
458 B
Bash

#!/bin/bash
UENV_PATH="/boot/uEnv.txt"
set -e
if [ "$(id -u)" -ne "0" ]; then
echo "This script requires root."
exit 1
fi
case $1 in
on) sed -i.bak '/debug=/c\debug=on' $UENV_PATH
echo "Debug on headphone port enabled. Please reboot !"
;;
off) sed -i.bak '/debug=/c\debug=off' $UENV_PATH
echo "Debug on headphone port disabled. Please reboot !"
;;
*)
echo "Unknown option! Usage: debug_switch on|off "
esac