I am trying to disable sharing options from System preferences on MacOS, but from my understanding you cannot permanently disable them, but you can turn them off.
For example to disable file sharing I can use
launchctl disable system/com.apple.smbd
But to apply changes, you will have to restart the device first and I don't want to restart all devices if the option is not enabled. Is there a way, I can first check if the option is on via terminal or script?
Thanks