Mine
public shellscript v1 · immutable#!/bin/sh# The default rule assumes that the nodes are connected to the PDU andswitch# located in the same rack. Only the exceptions need to be# explicitly listed here.for ip in $@ ; do hostname=`nslookup $ip | grep "name =" | awk '{print $4}' | sed -e's/\.local\.$//' ` case $hostname in compute-14-3) rack="/Rack15" ;; *) rack=`echo $hostname | sed -e's/^[a-z]*-\([0-9]*\)-[0-9]*.*/\/Rack\1/'` ;; esac echo $rackdone