From b4265195f4823618c60274458f885ef61c2452e1 Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Sun, 8 Dec 2019 02:41:36 -0500 Subject: [PATCH] refactoring --- debian/security-misc.preinst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/security-misc.preinst b/debian/security-misc.preinst index 5a564ee..ee2423a 100644 --- a/debian/security-misc.preinst +++ b/debian/security-misc.preinst @@ -15,7 +15,7 @@ true " ##################################################################### " -if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then +sudo_users_check () { sudo_users="$(getent group sudo | cut -d: -f4)" ## example sudo_users: ## user,root @@ -52,7 +52,9 @@ if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then echo "https://www.whonix.org/wiki/security-misc#install" >&2 exit 200 fi +} +console_users_check() { console_users="$(getent group console | cut -d: -f4)" ## example sudo_users: ## user @@ -89,6 +91,11 @@ if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then echo "https://www.whonix.org/wiki/security-misc#install" >&2 exit 201 fi +} + +if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then + sudo_users_check + console_users_check fi true "INFO: debhelper beginning here."