diff options
author | James Smith <james@loopj.com> | 2012-07-24 13:39:07 -0700 |
---|---|---|
committer | James Smith <james@loopj.com> | 2012-07-24 13:39:07 -0700 |
commit | 772bc51c3a2372592c400e0d4e159a0128989ba2 (patch) | |
tree | 191af002e272ce95418910b9c0ea63443e48e681 /plugins/wakeonlan/wakeonlan.plugin.zsh | |
parent | 0ba398f9e1aaf05e72406d5c840f013eebb6b260 (diff) | |
parent | d05b2010ffd4cd33ff9402c402051b1caf985d97 (diff) | |
download | zsh-772bc51c3a2372592c400e0d4e159a0128989ba2.tar.gz zsh-772bc51c3a2372592c400e0d4e159a0128989ba2.tar.bz2 zsh-772bc51c3a2372592c400e0d4e159a0128989ba2.zip |
Merge
Diffstat (limited to 'plugins/wakeonlan/wakeonlan.plugin.zsh')
-rw-r--r-- | plugins/wakeonlan/wakeonlan.plugin.zsh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/wakeonlan/wakeonlan.plugin.zsh b/plugins/wakeonlan/wakeonlan.plugin.zsh new file mode 100644 index 000000000..6cef7d44a --- /dev/null +++ b/plugins/wakeonlan/wakeonlan.plugin.zsh @@ -0,0 +1,14 @@ +function wake() { + local config_file="$HOME/.wakeonlan/$1" + if [[ ! -f "$config_file" ]]; then + echo "ERROR: There is no configuration file at \"$config_file\"." + return 1 + fi + + if (( ! $+commands[wakeonlan] )); then + echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?" + return 1 + fi + + wakeonlan -f "$config_file" +} |