From 65355d2b76d0e241224b230d3257c7e60ee0c305 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 2 Mar 2023 09:37:37 -0300 Subject: bin/reconfigure: Early exit when ran as root --- bin/reconfigure | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bin/reconfigure') diff --git a/bin/reconfigure b/bin/reconfigure index 7e49f00..af94f48 100755 --- a/bin/reconfigure +++ b/bin/reconfigure @@ -62,6 +62,13 @@ done shift $((OPTIND - 1)) +if [ "$(id -un)" = 'root' ]; then + printf 'This script must *not* be run as root.\n\n' >&2 + usage >&2 + exit 2 +fi + + HOSTNAME="$(hostname)" if [ -e /run/current-system/configuration.scm ]; then -- cgit v1.2.3