From c46764a5f6f7aa4f09bab4a38305ae4e39d65bb8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 27 May 2024 18:37:18 +0200 Subject: check for privileges before preparing --- bin/pacman-offline | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/pacman-offline b/bin/pacman-offline index ae657fb..fbb9526 100755 --- a/bin/pacman-offline +++ b/bin/pacman-offline @@ -33,6 +33,11 @@ while getopts 'cfhrty' opt; do esac done +if [ "${UID}" -ne 0 ]; then + echo "You need elevated privileges. Please run as user 'root'!" >&2 + exit 1 +fi + OPTIND=1 while getopts 'cfhrty' opt; do case ${opt} in -- cgit v1.2.3-54-g00ecf