dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit d11ee582a92f7d9d69e828e13b4c0d674df30e7b
parent 807089d1c8b72afab7c8d6c7cabb92f2d60d1e44
Author: Alex Balgavy <a.balgavy@gmail.com>
Date:   Wed, 31 Jul 2019 17:38:18 +0200

updatemaster: don't ask for sudo in maintenance mode

Former-commit-id: 8ce1ccfe1a108ec571e2faaa49ac108a84a5b95c
Diffstat:
Mscripts/updatemaster | 18++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/scripts/updatemaster b/scripts/updatemaster @@ -39,13 +39,6 @@ cache_sudo() { } # }}} -echo_progress "### STARTING UPDATE SCRIPT ###\n" -echo "Please enter the administrator password (required for installation/upgrading)." -sudo -v -cache_sudo & -cache_sudo_pid=$! -trap clean_up SIGINT SIGKILL SIGQUIT SIGTERM - # Parse options/arguments {{{ while getopts "hfcns" opt; do case "$opt" in @@ -91,6 +84,15 @@ if ! command -v notify &> /dev/null; then fi # }}} +echo_progress "### STARTING UPDATE SCRIPT ###\n" +if [ -z $maintenance ]; then + echo "Please enter the administrator password (required for installation/upgrading)." + sudo -v + cache_sudo & + cache_sudo_pid=$! + trap clean_up SIGINT SIGKILL SIGQUIT SIGTERM +fi + # Homebrew {{{ echo_progress "Homebrew update/upgrade." if command -v brew &> /dev/null; then @@ -101,7 +103,7 @@ if command -v brew &> /dev/null; then echo # Programs {{{ - if [ $formulas = 0 ] && [ ${#outdated} -ne 0 ]; then + if [ $maintenance = 1 ] || ([ $formulas = 0 ] && [ ${#outdated} -ne 0 ]); then brew outdated echo_succ "No programs will be updated." elif [ ${#outdated} = 0 ]; then