mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

wake (288B)


      1 #!/bin/bash
      2 
      3 # wake machine via proxy using database
      4 
      5 MACHINE="$1"
      6 DB="$HOME/config/private/wakeonlan"
      7 
      8 PROXY=$(grep "^$1" "$DB" | cut -d ' ' -f2)
      9 MAC=$(grep "^$1" "$DB" | cut -d ' ' -f3)
     10 
     11 if [ -z "$PROXY" ]
     12 then
     13   echo "unknown machine $MACHINE"
     14 else
     15   ssh "$PROXY" wakeonlan "$MAC"
     16 fi
     17