Is this the best way to start/stop/status filesharing for macOS ?
-- AppleScript to enable File Sharing on macOS
do shell script "sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.smbd.plist" with administrator privileges
do shell script "sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist" with administrator privileges
-- AppleScript to disable File Sharing on macOS
do shell script "sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.smbd.plist" with administrator privileges
do shell script "sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist" with administrator privileges