Skip to content

Commit

Permalink
Do not require root privileges if -h is used.
Browse files Browse the repository at this point in the history
  • Loading branch information
emcrisostomo committed May 5, 2015
1 parent dfb9ac0 commit c48d60c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tm-cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ set -o nounset

PROGNAME=$0

(( ${EUID} == 0 )) || {
>&2 print -- This command must be executed with super user privileges.
exit 1
}

command -v tmutil > /dev/null 2>&1 || {
>&2 print -- Cannot find tmutil.
exit 1
Expand Down Expand Up @@ -97,6 +92,11 @@ shift $((OPTIND-1))
exit 2
}

(( ${EUID} == 0 )) || {
>&2 print -- This command must be executed with super user privileges.
exit 1
}

# Check if a backup is running and if it is, skip execution.
# This check relies on the undocumented tmutil `status' verb.
if (( ${FORCE_EXECUTION} == 0 )) && tmutil status | grep Running | grep -q 1
Expand Down

0 comments on commit c48d60c

Please sign in to comment.