summaryrefslogtreecommitdiff
path: root/src/util.sh
diff options
context:
space:
mode:
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