sleep-until: fix dry output
This commit is contained in:
parent
c03af6f32e
commit
28cde12854
1 changed files with 1 additions and 1 deletions
|
@ -8,8 +8,8 @@ if [ -n "$1" ] && date --date="$*" > /dev/null 2>&1; then
|
|||
# Calculate the time in seconds to sleep by subtracting the future time from the current time
|
||||
SLEEP_TIME="$(( $(date -f - +%s- <<< "$*"$'\nnow') 0 ))"
|
||||
if [ "$SLEEP_TIME" -gt 0 ]; then
|
||||
echo "Sleeping until: $(date --date="$*") (${SLEEP_TIME}s)"
|
||||
if ! "$DRY"; then
|
||||
echo "Sleeping until: $(date --date="$*") (${SLEEP_TIME}s)"
|
||||
sleep "$SLEEP_TIME"
|
||||
else
|
||||
echo "$SLEEP_TIME"
|
||||
|
|
Loading…
Add table
Reference in a new issue