# Make sure we can actually do anything meaningful:
SUDO=''
if (( $EUID != 0 )); then
- if ! command -pv "sudo" > /dev/null ; then
- echo 'The `sudo´ command is required but not installed, aborting!'
- echo 'Alternatively you may run this script as root.'
- exit 99
+ if ! sudo -l xbps-install >/dev/null 2>&1 ; then
+ echo 'WARNING: The `sudo´ command is not available or you have'
+ echo 'insufficient privileges. You will not be able to make changes'
+ echo 'to the package system, unless you re-run this script as root.'
+ echo -e '\nPress ENTER to continue ...'
+ read
+ else
+ SUDO='sudo'
fi
- SUDO='sudo'
fi
# Check/install essential prerequisites: