20 lines
285 B
Bash
Executable File
20 lines
285 B
Bash
Executable File
#!/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
|
|
|