#!/bin/sh . ${CIRROS_LIB:=/lib/cirros/shlib_cirros} || { echo "failed to read ${CIRROS_LIB}" 1>&2; exit 1; } Usage() { cat < "$TEMP_D/ip-addr-show" ipinfo < "$TEMP_D/ip-addr-show" IFS="|"; set -- $_RET; IFS="$oifs" for x in "$@"; do echo "if-info: $x" done ip route | sed 's,^,ip-route:,' if assert_datasource; then echo "=== datasource: $_DATASOURCE_NAME $_DATASOURCE_MODE ===" for x in instance-id name availability-zone local-hostname \ launch-index; do ds_get_item "$x" && val="$_RET" || val="N/A" echo "$x: ${val}" done else echo "=== datasource: None None ===" fi local cur="" avail="" msg="" cirros_version_available && avail="$_RET" cirros_version && cur="$_RET" msg="current=$cur" [ "$avail" != "0.0" ] && msg="$msg latest=$avail" read_uptime && [ -n "$_RET" ] && msg="$msg uptime=$_RET" echo "=== cirros: $msg ===" if ! check_ping_gateway; then echo "=== pinging gateway failed, debugging connection ===" debug_connection fi return 0 } cirros_status "$@" # vi: ts=4 noexpandtab