diff options
author | davidovski <david@davidovski.xyz> | 2022-04-12 12:16:47 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-04-12 12:16:47 +0100 |
commit | 6a757a93556770f227be9bdd85ce68c44d047777 (patch) | |
tree | 65aca039dd164fa6ea85e3f2cc63d3fb30b9014e /src/xi.sh | |
parent | 30be8ddd88f617f21b874e623f2da8643fe2699c (diff) |
added serial downloads and checking for rootv1.2.0
Diffstat (limited to 'src/xi.sh')
-rwxr-xr-x | src/xi.sh | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 |