Latest
This commit is contained in:
parent
42a3e50632
commit
41ef8eb986
3 changed files with 23 additions and 4 deletions
|
@ -132,6 +132,7 @@ upgradeDarwin() {
|
|||
|
||||
### Run upgrade process
|
||||
logg info 'Applying OS upgrades (if available)'
|
||||
logg info 'This may take awhile..'
|
||||
expect -c "set timeout -1
|
||||
spawn sudo softwareupdate -i -a --agree-to-license
|
||||
expect \"Password:\"
|
||||
|
@ -165,10 +166,6 @@ upgradeDarwin() {
|
|||
|
||||
### Reboot
|
||||
logg info 'Reboot required' && exit 140
|
||||
# gtimeout 60 osascript -e 'tell application "Finder" to shut down' || OSASCRIPT_EXIT_CODE=$?
|
||||
# if [ -n "$OSASCRIPT_EXIT_CODE" ]; then
|
||||
# logg info 'Reboot required and failed to gracefully shutdown within 1 minute, so forcing reboot' && sudo sh -c 'shutdown -r now'
|
||||
# fi
|
||||
else
|
||||
logg info 'No reboot required for softwareupdate'
|
||||
fi
|
||||
|
|
|
@ -97,6 +97,11 @@ if [ "$BASH_SUPPORT" = 'true' ]; then
|
|||
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/motd.sh" ]; then
|
||||
. "${XDG_CONFIG_HOME:-$HOME/.config}/shell/motd.sh"
|
||||
fi
|
||||
|
||||
### SUDO_ASKPASS
|
||||
if [ -d /Applications ] && [ -d /System ]; then
|
||||
SUDO_ASKPASS="$HOME/.local/bin/sudo-askpass"
|
||||
fi
|
||||
fi
|
||||
|
||||
### Cargo
|
||||
|
|
17
home/dot_local/bin/executable_sudo-askpass
Normal file
17
home/dot_local/bin/executable_sudo-askpass
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
# @file Sudo Password Helper
|
||||
# @brief Integrates sudo password entry with native system dialogs for `SUDO_ASKPASS`
|
||||
# @description
|
||||
# Many programs allow you to define the `SUDO_ASKPASS` environment variable to handle passing in
|
||||
# sudo privileges. For more details, check out [this StackOverflow post](https://stackoverflow.com/questions/12608293/how-to-setup-a-sudo-askpass-environment-variable).
|
||||
|
||||
if [ -z "$SUDO_PASSWORD" ]; then
|
||||
if [ -d /Applications ] && [ -d /System ]; then
|
||||
### macOS
|
||||
SUDO_PASSWORD="$(osascript -e 'Tell application "System Events" to display dialog "Administrator Password:" default answer "" with hidden answer' -e 'text returned of result' 2>/dev/null)"
|
||||
else
|
||||
### Linux
|
||||
SUDO_PASSWORD="TODO"
|
||||
fi
|
||||
fi
|
||||
echo "$SUDO_PASSWORD"
|
Loading…
Reference in a new issue