From 2f282f851885245e26fbcf7273cd8f71df8a8828 Mon Sep 17 00:00:00 2001 From: Mentor Date: Mon, 19 Sep 2022 00:05:55 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20disable=20maintenance=20if=20man?= =?UTF-8?q?ual=20command=20is=20called?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- battery.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/battery.sh b/battery.sh index 4836387..aba920d 100644 --- a/battery.sh +++ b/battery.sh @@ -170,6 +170,9 @@ if [[ "$action" == "charging" ]]; then log "Setting $action to $setting" + # Disable running daemon + battery maintain stop + # Set charging to on and off if [[ "$setting" == "on" ]]; then enable_charging @@ -184,6 +187,9 @@ fi # Charging on/off controller if [[ "$action" == "charge" ]]; then + # Disable running daemon + battery maintain stop + # Start charging battery_percentage=$( get_battery_percentage ) log "Charging to $setting% from $battery_percentage%" @@ -282,6 +288,8 @@ if [[ "$action" == "maintain" ]]; then # Enable the daemon that continues maintaining after reboot battery create_daemon + + exit 0 fi @@ -328,11 +336,14 @@ if [[ "$action" == "create_daemon" ]];then echo "$daemon_definition" > "$daemon_path" + exit 0 + fi # Remove daemon if [[ "$action" == "remove_daemon" ]];then rm $daemon_path + exit 0 fi \ No newline at end of file