summaryrefslogtreecommitdiff
path: root/scripts/00-init.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/00-init.sh')
-rw-r--r--scripts/00-init.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/00-init.sh b/scripts/00-init.sh
new file mode 100644
index 0000000..43aa251
--- /dev/null
+++ b/scripts/00-init.sh
@@ -0,0 +1,18 @@
+# scripts/00-init.sh
+
+Init ()
+{
+ # Check if user is root
+ if [ "`id -u`" -ne "0" ]
+ then
+ echo "E: ${PROGRAM} requires superuser privilege."
+ exit 1
+ fi
+
+ # Check if build directory already exists
+ if [ -d "${LIVE_ROOT}" ] && [ ! -d "${LIVE_ROOTFS}" ]
+ then
+ echo "E: found an (unfinished) system, remove it and re-run ${PROGRAM}."
+ exit 1
+ fi
+}