From 5decc65ce6e356bf28016b616a679d778af55426 Mon Sep 17 00:00:00 2001 From: Mentor Date: Fri, 28 Jan 2022 10:31:38 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20weird=20occasional=20bug?= =?UTF-8?q?=20where=20script=20gets=20confudes=20by=20fi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- battery.sh | 9 +++++++++ setup.sh | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/battery.sh b/battery.sh index 6c61da0..8f14f87 100644 --- a/battery.sh +++ b/battery.sh @@ -91,11 +91,13 @@ function log() { # Help message if [ -z "$action" ]; then echo -e "$helpmessage" + exit 0 fi # Visudo message if [[ "$action" == "visudo" ]]; then echo -e "$visudoconfig" + exit 0 fi # Update helper @@ -104,6 +106,8 @@ if [[ "$action" == "update" ]]; then echo "Press any key to continue" read curl -sS https://raw.githubusercontent.com/actuallymentor/battery/main/setup.sh | sudo bash + battery + exit 0 fi @@ -119,6 +123,8 @@ if [[ "$action" == "charging" ]]; then disable_charging fi + exit 0 + fi # Charging on/off controller @@ -141,6 +147,8 @@ if [[ "$action" == "charge" ]]; then disable_charging log "Charging completed at $battery_percentage%" + exit 0 + fi @@ -148,5 +156,6 @@ fi if [[ "$action" == "status" ]]; then log "Battery at $( get_battery_percentage )% ($( get_remaining_time ) remaining), smc charging $( get_smc_charging_status )" + exit 0 fi diff --git a/setup.sh b/setup.sh index 85ef429..f97c316 100644 --- a/setup.sh +++ b/setup.sh @@ -33,4 +33,4 @@ echo -e "\nRemoving temp folder $tempfolder" rm -rf $tempfolder echo -e "\nSmc binary built" -echo -e "\nBattery tool installed. Type \"battery\" for instructions." +echo -e "\nšŸŽ‰ Battery tool installed. Type \"battery\" for instructions."