Skip to content

Instantly share code, notes, and snippets.

View mattparkins's full-sized avatar

Matt Parkins mattparkins

View GitHub Profile
@mattparkins
mattparkins / Enforce sudo.sh
Last active March 27, 2019 10:08
Are we already su? If not then ask for it
# Are we already su? If not then ask for it
if [[ "$EUID" != 0 ]]; then
sudo -k # make sure to ask for password on next sudo
if ! sudo true; then
echo "Password fail, aborting"
exit 1
fi
fi