diff --git a/scripts/sudo-user.sh b/scripts/sudo-user.sh new file mode 100755 index 0000000..e8d5ea5 --- /dev/null +++ b/scripts/sudo-user.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -E -o errexit -o nounset -o pipefail + +USER_FILE="/etc/sudoers.d/$USER" + +if [ -f $USER_FILE ]; then + echo "Sudo file $USER_FILE already exists!" + exit 1 +fi +echo "$USER ALL=(ALL) NOPASSWD:ALL" | sudo tee $USER_FILE