Skip to content

Instantly share code, notes, and snippets.

@diegogslomp
Created January 4, 2017 20:13
Show Gist options
  • Save diegogslomp/519bc91dae20667912e76cdb41dc12b9 to your computer and use it in GitHub Desktop.
Save diegogslomp/519bc91dae20667912e76cdb41dc12b9 to your computer and use it in GitHub Desktop.
#!/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