add script bin/afradoor

This commit is contained in:
Lexi / Zoe 2019-01-25 20:30:38 +01:00
parent b0a364c6a5
commit c2a490567c
1 changed files with 19 additions and 0 deletions

19
bin/afradoor Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
# Get command
[[ $# -eq 1 ]] || { echo "missing argument, use 'open' or 'close'"; exit 1; }
cmd=$1
shift
# Parse command
case "$cmd" in
open|close)
ssh -i ~/.ssh/id_afradoor $cmd@door
;;
*)
echo "Unknown command '$cmd', use 'open' or 'close'."
exit 1
;;
esac