Swap
Swap copied to clipboard
Check for root/sudo access at beginning of script.
Prevents trying to run multiple commands if the user doesn't have root/sudo access. As well, runs commands directly without invoking sudo if the user is already root.