diff --git a/install.sh b/install.sh index 621e48d2..669d6638 100755 --- a/install.sh +++ b/install.sh @@ -244,6 +244,7 @@ install_data pdist/pdistd.socket "$DESTDIR$systemdunitd install_data pdist/pdistd@.service "$DESTDIR$systemdunitdir/pdistd@.service" install_exec pdist/pdist-bootcheck "$DESTDIR$usr_exec_prefix/libexec/pdist-bootcheck" install_data pdist/pdist-bootcheck.service "$DESTDIR$systemdunitdir/pdist-bootcheck.service" +install_exec wakeonlan/wake "$DESTDIR$usr_bindir/wake" postinstall exit diff --git a/wakeonlan/wake b/wakeonlan/wake new file mode 100755 index 00000000..ef610824 --- /dev/null +++ b/wakeonlan/wake @@ -0,0 +1,9 @@ +#! /bin/bash + +die() { echo "$*" >&2; exit 1; } +usage() { die "usage: $0 hostname"; } +(( $# == 1 )) || usage +read -r ha rest <<< "$(getent ethers $1)" +[ "$ha" ] || die "$1: hardware address unknown. Please write to helpdesk@molgen.mpg.de." +/usr/sbin/wakeonlan $ha +echo "If your machine doesn't come online in a minute, please write to helpdesk@molgen.mpg.de."