add test for root user
This commit is contained in:
parent
dc3c53d7c8
commit
fa471fdf9f
|
@ -3,6 +3,12 @@
|
|||
_updates_available="0"
|
||||
_target_file="/tmp/pacman-update-count"
|
||||
_user="ray"
|
||||
_user_id=$(id -u)
|
||||
|
||||
if ! [ "$_user_id" -eq 0 ] ; then
|
||||
echo "pacman-update-count.sh: insufficient priviliges: must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pacman -Sy
|
||||
_query_output=$(pacman -Qu)
|
||||
|
|
Loading…
Reference in New Issue