wakeonlan.plugin.zsh 354 B

123456789101112131415
  1. function wake() {
  2. local config_file=~/.wakeonlan/$1
  3. if [[ ! -f $config_file ]]; then
  4. echo "ERROR: There is no configuration file at \"$config_file\"."
  5. return
  6. fi
  7. which wakeonlan > /dev/null
  8. if [[ ! $? == 0 ]]; then
  9. echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?"
  10. return
  11. fi
  12. wakeonlan -f $config_file
  13. }