Fix more bugs

This commit is contained in:
Santiago Lo Coco 2024-04-10 11:22:26 +02:00
parent 3caf0d7df6
commit 0b3c6bfe92
1 changed files with 6 additions and 1 deletions

View File

@ -85,7 +85,7 @@ install_launch_daemon() {
fi fi
sudo cp "$share_plist" "$launch_daemon" sudo cp "$share_plist" "$launch_daemon"
sudo chown root:wheel "$launch_daemon" sudo chown root:wheel "$launch_daemon"
sudo launchctl load "$launch_daemon" sudo launchctl load -w "$launch_daemon"
} }
get_cached_status() { get_cached_status() {
@ -113,6 +113,11 @@ runScript() {
"revert") "revert")
enable_charging enable_charging
disable_discharging disable_discharging
launch_daemon=/Library/LaunchDaemons/cbattery.plist
if [[ -f "$launch_daemon" ]]; then
sudo launchctl unload -w "$launch_daemon"
sudo rm "$launch_daemon"
fi
;; ;;
"charging") "charging")
echo "Setting $action to $setting" echo "Setting $action to $setting"