Actual end date (parsed) on -v
This commit is contained in:
parent
8c4fb9eb95
commit
4e294455be
|
@ -11,10 +11,11 @@ seconds_until() {
|
||||||
# Function to sleep until a given datetime
|
# Function to sleep until a given datetime
|
||||||
sleep_until() {
|
sleep_until() {
|
||||||
target="$1"
|
target="$1"
|
||||||
|
extended_format=$(date -d "$target" "+%c") # Format datetime into extended format
|
||||||
seconds=$(seconds_until "$target")
|
seconds=$(seconds_until "$target")
|
||||||
if [ $seconds -gt 0 ]; then
|
if [ $seconds -gt 0 ]; then
|
||||||
if [ "$verbose" == true ]; then
|
if [ "$verbose" == true ]; then
|
||||||
echo "Sleeping until $target..."
|
echo "Sleeping until $extended_format..."
|
||||||
fi
|
fi
|
||||||
sleep $seconds
|
sleep $seconds
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user