From 62ac6c319289550931696346ce08f2c0ed70fc0d Mon Sep 17 00:00:00 2001 From: davidovski Date: Sun, 28 Aug 2022 18:31:25 +0000 Subject: fixed removing removing from wrong sysroot --- src/util.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/util.sh') diff --git a/src/util.sh b/src/util.sh index f92e4e3..871fe2a 100644 --- a/src/util.sh +++ b/src/util.sh @@ -1,9 +1,21 @@ #!/bin/sh +# Download a file and find out the http code +# download_file() { curl ${CURL_OPTS} -o $1 -w "%{http_code}" $2 2>> ${LOG_FILE} } + +# Check if the user can write to the selected systemroot +# +checkroot () { + [ -w "${SYSROOT}" ] || { + printf "${RED}Please run as root!${RESET}\n" + exit 1 + } +} + # this function is broken wait_for_jobs () { local text=$1 -- cgit v1.2.1