Add shinobi, wakeonlan workaround, optimized harmony switch code
Tá an tiomantas seo le fáil i:
22
scripts/install-wakeonlan-sshkey.sh
Comhad infheidhmithe
22
scripts/install-wakeonlan-sshkey.sh
Comhad infheidhmithe
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR=$(dirname "$(readlink -f "$0")")
|
||||
|
||||
KEYFILE="$DIR/../ssh-key/homeassistant-wakeonlan-sshkey"
|
||||
TARGET="$HOME/.ssh/authorized_keys"
|
||||
|
||||
if [ ! -f $KEYFILE ]; then
|
||||
echo "You need to create the SSH-Key-File first: \"$KEYFILE\""
|
||||
echo "Use: \"ssh-keygen -t ed25519 -C homeassistant-wakeonlan-sshkey -f $KEYFILE\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! which wakeonlan > /dev/null; then
|
||||
echo "You need to install \"wakeonlan\" first. Otherwise the ssh-key will be useless."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SSHKEY=$(<"$KEYFILE.pub")
|
||||
echo "command=\"wakeonlan \$SSH_ORIGINAL_COMMAND\" $SSHKEY" >> $TARGET
|
||||
|
||||
echo "Installed the ssh key into \"$TARGET\"."
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir