Created
March 7, 2024 12:24
-
-
Save Dagimal/ea65820e1825e9ecedbda418c0d0d616 to your computer and use it in GitHub Desktop.
add to /etc/update-motd.d/99-countdown
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Tanggal target (ganti dengan tanggal yang diinginkan) | |
| target_date="2024-12-31" | |
| # Hitung mundur sisa hari | |
| current_date=$(date +%Y-%m-%d) | |
| days_left=$(echo $(( ($(date -d "$target_date" +%s) - $(date -d "$current_date" +%s)) / 86400 ))) | |
| # Tampilkan pesan MOTD | |
| echo "===============================================" | |
| echo " COUNTDOWN TO TARGET DATE " | |
| echo "===============================================" | |
| echo "" | |
| echo " Target Date: $target_date" | |
| echo " Days Left : $days_left" | |
| echo "" | |
| echo "===============================================" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment