From 0bfa83ff9ea8695aff929ea46b17ef049938aaee Mon Sep 17 00:00:00 2001 From: Chris Boudacoff Date: Fri, 4 May 2018 08:16:49 +0300 Subject: [PATCH] Add files via upload --- .../A64-TERES/teres1-debug/debug_switch.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 SOFTWARE/A64-TERES/teres1-debug/debug_switch.sh diff --git a/SOFTWARE/A64-TERES/teres1-debug/debug_switch.sh b/SOFTWARE/A64-TERES/teres1-debug/debug_switch.sh new file mode 100644 index 00000000..3abedd5d --- /dev/null +++ b/SOFTWARE/A64-TERES/teres1-debug/debug_switch.sh @@ -0,0 +1,19 @@ +#!/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