#!/bin/sh # $Id: wake 954 2010-01-20 09:57:24Z allen $ if [ -e /etc/macmap ]; then if [ -z "$1" ]; then echo "Usage: wake " else echo "Trying to wake up host '$1'" hostline=`grep -E "^$1," /etc/macmap` [ $? -ne 0 ] && echo "The host '$1' could not be found. Please check that the hostname is spelled correctly." echo $hostline |cut -d, -f2 |sed -e 's/;/\n/g' |xargs -i{} wakeonlan {} [ $? -ne 0 ] && echo "An error ocurred when trying to wake up '$1'. Please contact the IT support on help@maths.ox.ac.uk." fi fi