From 598044c076ef0cb7e84817d52e7299df092f09b6 Mon Sep 17 00:00:00 2001
From: tracer <tracer@24unix.net>
Date: Fri, 3 Jan 2020 13:19:41 +0100
Subject: [PATCH] added root check

---
 setup.sh | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/setup.sh b/setup.sh
index 7207162..2105a88 100644
--- a/setup.sh
+++ b/setup.sh
@@ -1,6 +1,13 @@
 #!/bin/sh
 
 cp Settings/.zshrc Settings/.vimrc Settings/.zprofile Settings/.gitconfig .
-if [ ! -d /usr/local/bin ]; then mkdir -p /usr/local/bin; fi
-cp Settings/cdbm /usr/local/bin
+
+if [ $(id -u) -ne 0 ]
+then
+	echo "run me as root to copy cdbm to the system"
+else
+	if [ ! -d /usr/local/bin ]; then mkdir -p /usr/local/bin; fi
+	cp Settings/cdbm /usr/local/bin
+fi
+