Skip to content

Commit

Permalink
Fix acc -f
Browse files Browse the repository at this point in the history
  • Loading branch information
VR-25 committed Jun 12, 2022
1 parent 1076997 commit 5746f7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
9 changes: 2 additions & 7 deletions install/acc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -350,28 +350,23 @@ case "${1-}" in

-f|--force|--full)

shutdown_capacity=
cooldown_capacity=
cooldown_temp=
cooldown_charge=
cooldown_pause=
max_temp=
max_temp_pause=
cooldown_custom=
apply_on_boot=
apply_on_plug=
max_charging_current=
max_charging_voltage=

pause_capacity=${2:-100}
resume_capacity=$(( pause_capacity - 1 ))
runCmdOnPause_="exec $TMPDIR/accd"
resume_capacity=$((pause_capacity - 1))

cp -f $config $TMPDIR/.acc-f-config
config=$TMPDIR/.acc-f-config
. $execDir/write-config.sh
print_charging_enabled_until ${2:-100}%
echo
echo ": ; accf=\"exec $TMPDIR/accd\"" >> $config
exec $TMPDIR/accd $config
;;

Expand Down
5 changes: 2 additions & 3 deletions install/misc-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ disable_charging() {
chargingDisabled=true
fi

(set +eux
eval '${runCmdOnPause-}'
eval '${runCmdOnPause_-}') || :
(set +eux; eval '${runCmdOnPause-}') || :
eval '${accf-}'
}

if [ -n "${1-}" ]; then
Expand Down

0 comments on commit 5746f7e

Please sign in to comment.