diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2019-06-03 21:27:12 -0700 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2019-06-04 13:53:13 -0400 |
commit | 6ec2060a291b873ba120aa7cda940c6604eac550 (patch) | |
tree | 535936aa4519419728572288a7edd09d10e4e101 /scrub/e2scrub_all.in | |
parent | cc035a95a2b012a542d58ecc66deca5e765af805 (diff) | |
download | e2fsprogs-6ec2060a291b873ba120aa7cda940c6604eac550.tar.gz |
e2scrub: remove -C from e2scrub_all
We already have the "SERVICE_MODE=1" feature that signals to e2scrub
that we're running as a background daemon and therefore we should exit
quietly if conditions aren't right.
It's therefore unnecessary to have a separate -C flag to achieve the
same outcome for cron jobs. Merge the two together.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'scrub/e2scrub_all.in')
-rw-r--r-- | scrub/e2scrub_all.in | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in index d99c8197..cdc37ced 100644 --- a/scrub/e2scrub_all.in +++ b/scrub/e2scrub_all.in @@ -26,7 +26,6 @@ if (( $EUID != 0 )); then fi scrub_all=0 -run_from_cron=0 snap_size_mb=256 reap=0 conffile="@root_sysconfdir@/e2scrub.conf" @@ -69,12 +68,11 @@ exitcode() { exit "${ret}" } -while getopts "nrACV" opt; do +while getopts "nrAV" opt; do case "${opt}" in "n") DBG="echo Would execute: " ;; "r") scrub_args="${scrub_args} -r"; reap=1;; "A") scrub_all=1;; - "C") run_from_cron=1;; "V") print_version; exitcode 0;; *) print_help; exitcode 2;; esac @@ -86,17 +84,13 @@ shift "$((OPTIND - 1))" # when e2scrub_all is run out of cron or a systemd timer. if ! type lsblk >& /dev/null ; then - if [ "${run_from_cron}" -eq 1 ] ; then - exitcode 0 - fi + test -n "${SERVICE_MODE}" && exitcode 0 echo "e2scrub_all: can't find lsblk --- is util-linux installed?" exitcode 1 fi if ! type lvcreate >& /dev/null ; then - if [ "${run_from_cron}" -eq 1 ] ; then - exitcode 0 - fi + test -n "${SERVICE_MODE}" && exitcode 0 echo "e2scrub_all: can't find lvcreate --- is lvm2 installed?" exitcode 1 fi |