From e9cf9050e0ed5d99f09e9aa80740a989e6cc8a60 Mon Sep 17 00:00:00 2001 From: Mohamed Hasan Date: Mon, 11 Oct 2021 18:09:44 +0300 Subject: [PATCH] Sudo/Root run check (#69) * check if script run as sudo/root * add "sudo user" * Update wondershaper Co-authored-by: Jacco <2254149+magnific0@users.noreply.github.com> --- wondershaper | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wondershaper b/wondershaper index 850bf29..c0deee7 100755 --- a/wondershaper +++ b/wondershaper @@ -15,6 +15,12 @@ # # See the ChangeLog for information on the individual contributions of the authors. +# Warn when make sure the script run as sudo user +# https://stackoverflow.com/a/21372328 +if [[ $(id -u) -ne 0 ]]; then + echo "Running as non root / sudo user" +fi + QUANTUM="6000"; VERSION="1.4.1"; CONF="/etc/systemd/wondershaper.conf";