#!/bin/bash # # Helper to make a web page with links to hosts and their consoles # (ILOs). Pass the name of the cluster as an optional parameter to # customise the page title. # # At present this is mainly to make it easier to navigate to the ILO # console of a machine based on its hostname instead of cutting and # pasting. The host link is not currently useful. This will be # expanded to emit more useful host links at some point. # # This script expects a file cluster.txt to exist and have the format: # HOSTNAME MACADDRESS IPADDR ILOIPADDR DOMAIN ROLE # # Usage : ./cluster-to-html.sh MYCLUSTER > mycluster.html # # if [[ ! -z "$1" ]]; then CLUSTERNAME="$1" fi if [[ ! -f "cluster.txt" ]]; then "Error: cluster.txt not found" exit fi echo -e "" echo -e "
\n$HOSTNAME | " echo -e "host | " echo -e "ilo | " echo -e "" echo -e "" echo -e "$ROLE" echo -e "" echo -e " | " echo -e "