Added check for chezmoi.txt
This commit is contained in:
parent
41ef8eb986
commit
dd81f34a5d
1 changed files with 1 additions and 1 deletions
|
@ -421,7 +421,7 @@ ensureWarpDisconnected() {
|
||||||
setupPasswordlessSudo() {
|
setupPasswordlessSudo() {
|
||||||
sudo -n true || SUDO_EXIT_CODE=$?
|
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" ] && [ -z "$SUDO_PASSWORD" ] && command -v chezmoi > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/home/.chezmoitemplates/secrets/SUDO_PASSWORD" ]; then
|
if [ -n "$SUDO_EXIT_CODE" ] && [ -z "$SUDO_PASSWORD" ] && command -v chezmoi > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/home/.chezmoitemplates/secrets/SUDO_PASSWORD" ] && [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/age/chezmoi.txt" ]; then
|
||||||
logg info "Acquiring SUDO_PASSWORD by using Chezmoi to decrypt ${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/home/.chezmoitemplates/secrets/SUDO_PASSWORD"
|
logg info "Acquiring SUDO_PASSWORD by using Chezmoi to decrypt ${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/home/.chezmoitemplates/secrets/SUDO_PASSWORD"
|
||||||
SUDO_PASSWORD="$(cat "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/home/.chezmoitemplates/secrets/SUDO_PASSWORD" | chezmoi decrypt)"
|
SUDO_PASSWORD="$(cat "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/home/.chezmoitemplates/secrets/SUDO_PASSWORD" | chezmoi decrypt)"
|
||||||
export SUDO_PASSWORD
|
export SUDO_PASSWORD
|
||||||
|
|
Loading…
Reference in a new issue