diff options
author | Theodore Ts'o <tytso@mit.edu> | 2019-03-20 21:58:52 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2019-03-21 18:11:37 -0400 |
commit | e97d4c46a4915d7c7d70e6ef9e66c9aea252213f (patch) | |
tree | e224c4cfd3ad2d9e26bd14ed1fac95e5724e4e80 /scrub | |
parent | c7d6525ecaab6a410e7875df5989fe753609ee08 (diff) | |
download | e2fsprogs-e97d4c46a4915d7c7d70e6ef9e66c9aea252213f.tar.gz |
e2scrub,e2scrub_all: print a (more understandable) error if not run as root
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'scrub')
-rw-r--r-- | scrub/e2scrub.in | 5 | ||||
-rw-r--r-- | scrub/e2scrub_all.in | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/scrub/e2scrub.in b/scrub/e2scrub.in index 30157496..666d6485 100644 --- a/scrub/e2scrub.in +++ b/scrub/e2scrub.in @@ -25,6 +25,11 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +if (( $EUID != 0 )); then + echo "e2scrub must be run as root" + exit 1 +fi + snap_size_mb=256 fstrim=0 reap=0 diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in index a53acbae..31ebc797 100644 --- a/scrub/e2scrub_all.in +++ b/scrub/e2scrub_all.in @@ -20,6 +20,11 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +if (( $EUID != 0 )); then + echo "e2scrub_all must be run as root" + exit 1 +fi + scrub_all=0 snap_size_mb=256 reap=0 |