Update 2 files

- /local/provision.sh
- /home/dot_local/bin/executable_provision.tmpl
This commit is contained in:
Brian Zalewski 2023-01-25 12:43:23 +00:00
parent aef810a0d8
commit f8b698e62a
2 changed files with 22 additions and 8 deletions

View file

@ -10,11 +10,18 @@
{{ includeTemplate "universal/logg" }} {{ includeTemplate "universal/logg" }}
### Prompt for sudo password and (optionally) enable passwordless sudo ### Prompt for sudo password
sudo -n true || SUDO_EXIT_CODE=$?
logg info 'Your user will temporarily be granted passwordless sudo for the duration of the script' logg info 'Your user will temporarily be granted passwordless sudo for the duration of the script'
if [ -n "$SUDO_EXIT_CODE" ]; then
logg info 'Press `CTRL+C` to bypass this prompt to either enter your password when needed or perform a non-privileged installation' logg info 'Press `CTRL+C` to bypass this prompt to either enter your password when needed or perform a non-privileged installation'
logg info 'Note: Non-privileged installations are not yet supported' logg info 'Note: Non-privileged installations are not yet supported'
fi
### Enable passwordless sudo
if ! sudo cat /etc/sudoers | grep '# TEMPORARY FOR INSTALL DOCTOR' > /dev/null; then
echo "$(whoami) ALL=(ALL:ALL) NOPASSWD: ALL # TEMPORARY FOR INSTALL DOCTOR" | sudo tee -a /etc/sudoers echo "$(whoami) ALL=(ALL:ALL) NOPASSWD: ALL # TEMPORARY FOR INSTALL DOCTOR" | sudo tee -a /etc/sudoers
fi
### Ensure ~/.local/share/megabyte-labs is a directory ### Ensure ~/.local/share/megabyte-labs is a directory
if [ ! -d "${XDG_DATA_DIR:-$HOME/.local/share}/megabyte-labs" ]; then if [ ! -d "${XDG_DATA_DIR:-$HOME/.local/share}/megabyte-labs" ]; then

View file

@ -180,11 +180,18 @@ logg() {
fi fi
} }
### Prompt for sudo password and (optionally) enable passwordless sudo ### Prompt for sudo password
sudo -n true || SUDO_EXIT_CODE=$?
logg info 'Your user will temporarily be granted passwordless sudo for the duration of the script' logg info 'Your user will temporarily be granted passwordless sudo for the duration of the script'
if [ -n "$SUDO_EXIT_CODE" ]; then
logg info 'Press `CTRL+C` to bypass this prompt to either enter your password when needed or perform a non-privileged installation' logg info 'Press `CTRL+C` to bypass this prompt to either enter your password when needed or perform a non-privileged installation'
logg info 'Note: Non-privileged installations are not yet supported' logg info 'Note: Non-privileged installations are not yet supported'
fi
### Enable passwordless sudo
if ! sudo cat /etc/sudoers | grep '# TEMPORARY FOR INSTALL DOCTOR' > /dev/null; then
echo "$(whoami) ALL=(ALL:ALL) NOPASSWD: ALL # TEMPORARY FOR INSTALL DOCTOR" | sudo tee -a /etc/sudoers echo "$(whoami) ALL=(ALL:ALL) NOPASSWD: ALL # TEMPORARY FOR INSTALL DOCTOR" | sudo tee -a /etc/sudoers
fi
### Qubes dom0 ### Qubes dom0
if command -v qubesctl > /dev/null; then if command -v qubesctl > /dev/null; then