Created
March 21, 2018 19:35
-
-
Save abenson/e353602dc5f7b0291769f2bf7ee15e37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# xupavail - see how many packages are available for upgrade | |
SUDO= | |
if command -v sudo >/dev/null && | |
sudo -l | grep -q -e ' ALL$' -e xbps-install; then | |
SUDO=sudo | |
elif [ "$(whoami)" != root ]; then | |
SUDO='su root -c '\''"$@"'\'' -- -' | |
fi | |
$SUDO xbps-install -SMun "$@" | grep -v hold | wc -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment