commit 562b4af551efc7249cb68f6d4b8909daf2ce7ce6
parent 2ad5398d523036f9512a0b8932216ba09a438d51
Author: Christoph Lohmann <20h@r-36.net>
Date: Sat, 23 Nov 2019 18:36:22 +0100
Shorten the test for root and be more polite.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/hosts-gen b/bin/hosts-gen
@@ -6,7 +6,7 @@ hostsfile="/etc/hosts"
hostfiles="$(ls -1 "${etcdir}" | grep '^[0-9]*-.*')"
-! [ "$(id -u)" = "0" ] && printf "Run as root\\n" && exit 1
+[ $(id -u ) -ne 0 ] && printf "Please run as root.\n" && exit 1
[ -e "$hostsfile" ] && cp "$hostsfile" "$hostsfile.bkp"