Skip to content

Commit

Permalink
Sudo/Root run check (#69)
Browse files Browse the repository at this point in the history
* check if script run as sudo/root

* add "sudo user"

* Update wondershaper

Co-authored-by: Jacco <2254149+magnific0@users.noreply.github.com>
  • Loading branch information
plusmnt and magnific0 authored Oct 11, 2021
1 parent 1602af0 commit e9cf905
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wondershaper
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit e9cf905

Please sign in to comment.