dev: automated commit - 2025-07-17 14:03:35

This commit is contained in:
Mariano Z. 2025-07-17 14:03:35 -03:00
parent b60e2c8e13
commit 387d523c9f
8 changed files with 10 additions and 11 deletions

42
runs/1-sudo Executable file
View file

@ -0,0 +1,42 @@
#!/usr/bin/env bash
# NAME: Configure passwordless sudo for wheel group
# REQUIRES: sudo
set -euo pipefail
# Source common functions
source "$(dirname "$0")/../common.sh" || {
echo "[ERROR] Could not source common.sh" >&2
exit 1
}
check_requirements() {
if ! is_root; then
log_error "This script requires root privileges"
log_info "Run with: sudo $0"
exit 1
fi
}
configure_sudo() {
local sudoers_file="/etc/sudoers.d/wheel"
local config_line="%wheel ALL=(ALL:ALL) NOPASSWD: ALL"
log_sudo "Configuring wheel group for passwordless sudo"
echo "$config_line" >"$sudoers_file"
chmod 440 "$sudoers_file"
log_info "Wheel group configured for passwordless sudo"
log_info "Users in wheel group can now use sudo without password"
}
main() {
init_script
check_requirements
configure_sudo
finish_script 0
}
main "$@"