🐛 disable maintenance if manual command is called

This commit is contained in:
Mentor
2022-09-19 00:05:55 +02:00
parent b30e680a59
commit 2f282f8518

View File

@@ -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