Created
September 22, 2015 23:58
-
-
Save quicklywilliam/848cf5a40d44c8c37b48 to your computer and use it in GitHub Desktop.
Kudo- Use Knock to run a command as root/sudo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function kudo { | |
export fullcmd="" | |
for i in "$@"; do export fullcmd="$fullcmd '${i}'";done | |
osascript -s so -e "do shell script \"$fullcmd 2>&1\" with administrator privileges" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
example usage?
is there a way to tap into the actual sudo command? (without ruining it that is)