For the case you're asking about, I agree with Liso's answer saying /usr/local/bin
(or perhaps /usr/local/sbin
), because your script kind of needs to act on the entire system.
But for completeness I want to add that if you would like to install a script under your own account without root access (which can be a good alternative for programs that are not related to system administration), I would suggest putting it in $HOME/.local/bin
. As noted in an answer on Unix & Linux SE, this directory is specified by the systemd file-hierarchy spec as the equivalent of /usr/bin
or /usr/local/bin
for individual users' programs. It seems to be catching on for Linux systems that don't use systemd as well.
/usr/bin
is effectively never a good choice for users to put stuff.man hier
. There you can read which directories can be used.