Created
January 4, 2017 20:13
-
-
Save diegogslomp/519bc91dae20667912e76cdb41dc12b9 to your computer and use it in GitHub Desktop.
Example from http://linuxcommand.org/wss0070.php
This file contains 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 | |
# system_page - A script to produce an system information HTML file | |
##### Constants | |
TITLE="System Information for $HOSTNAME" | |
RIGHT_NOW=$(date +"%x %r %Z") | |
TIME_STAMP="Updated on $RIGHT_NOW by $USER" | |
##### Functions | |
function system_info | |
{ | |
# Temporary function stub | |
echo "function system_info" | |
} | |
function show_uptime | |
{ | |
# Temporary function stub | |
echo "function show_uptime" | |
} | |
function drive_space | |
{ | |
# Temporary function stub | |
echo "function drive_space" | |
} | |
function home_space | |
{ | |
# Temporary function stub | |
echo "function home_space" | |
} | |
##### Main | |
cat <<- _EOF_ | |
<html> | |
<head> | |
<title>$TITLE</title> | |
</head> | |
<body> | |
<h1>$TITLE</h1> | |
<p>$TIME_STAMP</p> | |
$(system_info) | |
$(show_uptime) | |
$(drive_space) | |
$(home_space) | |
</body> | |
</html> | |
_EOF_ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment