Ok. So your terminal command looks like some kind of mashup between a couple of different things.
Let's start from with the killall
command. Before we do anything with that command, it's a good idea to know what it's going to kill. For that we run this command:
pgrep -fl accountsd
which, on my computer, shows this:
515 /System/Library/Frameworks/Accounts.framework/Versions/A/Support/accountsd
613 /System/Library/PrivateFrameworks/AppleMediaServices.framework/Resources/amsaccountsd
The second one is amsaccountsd
not accountsd
so I'll assume that you want to get rid of that one. So let's try pgrep -fl '/accountsd'
which gives us this:
515 /System/Library/Frameworks/Accounts.framework/Versions/A/Support/accountsd
Ah, ok, so now we now how to target the right one. Instead of using killall
we can use pkill
which works the exact same way as pgrep
:
pkill -fl '/accountsd'
Assuming that does what you want, then you'd probably just want a Keyboard Maestro macro that runs a shell script and have it run:
/usr/bin/pkill -fl '/accountsd'
and check to make sure that the exit code of that command is zero.
If you wanted to get fancy you could do something like this:
#!/usr/bin/env zsh -f
PATH="/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin"
pkill -fl '/accountsd'
EXIT="$?"
if [[ "$EXIT" == "0" ]]
then
echo "Success"
exit 0
else
echo "Failure (\$EXIT = $EXIT)"
exit 1
fi
#EOF
Which will give you an error code (1) if it doesn't work and '0' if it does, and also a bit more to go on if it doesn't work.
The other part…you don't need.
As for the part of the command:
ALL= NOPASSWD: /usr/bin/killall accountsd
that would be something that you would enter into the sudoers
file so you could run it with sudo
without having to enter your password. You don't need to use sudo
for this, so I recommend you just ignore that entirely.
Let me know if you need more info about any of this. Be glad to help.