summaryrefslogtreecommitdiff
path: root/src/xi.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-04-12 12:16:47 +0100
committerdavidovski <david@davidovski.xyz>2022-04-12 12:16:47 +0100
commit6a757a93556770f227be9bdd85ce68c44d047777 (patch)
tree65aca039dd164fa6ea85e3f2cc63d3fb30b9014e /src/xi.sh
parent30be8ddd88f617f21b874e623f2da8643fe2699c (diff)
added serial downloads and checking for rootv1.2.0
Diffstat (limited to 'src/xi.sh')
-rwxr-xr-xsrc/xi.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/xi.sh b/src/xi.sh
index 9bb6bbf..ae53795 100755
--- a/src/xi.sh
+++ b/src/xi.sh
@@ -64,6 +64,7 @@ Available Commands:
EOF
}
+
[ -z "${LIBDIR}" ] && LIBDIR=/usr/lib/xipkg
[ -f ${LIBDIR}/VERSION ] && VERSION=$(cat ${LIBDIR}/VERSION) || VERSION=
@@ -128,6 +129,12 @@ if [ "$#" = "0" ]; then
. ${LIBDIR}/stats.sh
show_xipkg_stats
else
+ # showing stats doesn't require root, so we can only check when we are here
+ [ ! "$EUID" == 0 ] && {
+ printf "${RED}Please run as root!\n"
+ exit 1
+ }
+ # todo check for permissions when we need them and ask them per request
case "$1" in
"sync")
sync