summaryrefslogtreecommitdiff
path: root/src/util.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-08-28 18:31:25 +0000
committerdavidovski <david@davidovski.xyz>2022-08-28 18:31:25 +0000
commit62ac6c319289550931696346ce08f2c0ed70fc0d (patch)
treedb46daf7ef3bb5d0e1dad5f05c39bb6afb743953 /src/util.sh
parent45fdd7d7bdbffe9bca29ff630b1fea917b2338c2 (diff)
fixed removing removing from wrong sysrootv1.7.4
Diffstat (limited to 'src/util.sh')
-rw-r--r--src/util.sh12
1 files changed, 12 insertions, 0 deletions
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