Created
December 18, 2013 12:11
-
-
Save k0nsl/8021280 to your computer and use it in GitHub Desktop.
Output hostname and uptime (in days only). The output is used in conjunction with a cronjob and output is redirected to a HTML file.
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 | |
| # uptime-bash.sh for https://k0nsl.org | |
| uptime=$(</proc/uptime) | |
| uptime=${uptime%%.*} | |
| days=$(( uptime/60/60/24 )) | |
| host=$(hostname) | |
| echo "<small>$host up for $days days so far :)</small>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment