aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2020-01-29 11:24:48 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2020-01-29 11:24:48 +0000
commit8fcf7a8e45abbdd145516ce35a11eefe038d6cd6 (patch)
tree6bb509f7be23bbf73ae96fe3a5f0dfcbaabe6433
parent26d3be39fcceedaf5a7ceee206031a44d35e6ff4 (diff)
downloadcpt-8fcf7a8e45abbdd145516ce35a11eefe038d6cd6.tar.gz
kiss: Don't show prompts if root already
FossilOrigin-Name: 464768aadb370d6d3c4302b63b8eda0b2f57d48480083179e1b4c4b69ff42a97
-rwxr-xr-xkiss5
1 files changed, 5 insertions, 0 deletions
diff --git a/kiss b/kiss
index 1280ea8..8181392 100755
--- a/kiss
+++ b/kiss
@@ -74,6 +74,11 @@ root_cache() {
#
# This change was needed as the existing behavior was not ideal
# in any way and needed to be fixed.
+
+ # Pointless running this function if the user has chosen to run
+ # the package manager as root anyway.
+ [ "$(id -u)" != 0 ] || return 0
+
printf 'Password: '
# Disable echoing to the terminal while the password is inputted