Files
@ 0604be9af673
Branch filter:
Location: ChaosStuff/cnc-dashboard/init.sh - annotation
0604be9af673
713 B
text/x-sh
Remove unused aur task from initial
10c0cde7f869 10c0cde7f869 c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac d7197ecf1533 c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac c3309581c2ac | #!/usr/bin/env bash
generateKey() {
touch sshKey
touch sshKey.pub
rm sshKey
rm sshKey.pub
ssh-keygen -t ed25519 -f ./sshKey -q -N "" -C ""
}
deployKey() {
sshpass -p alarm ssh-copy-id -i ./sshKey.pub -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o PubkeyAuthentication=false alarm@"$1"
}
# If keys are present, we just need to deploy it and destroy the SSH Agent
# Otherwise, we genrate a key and then deploy it
# The key can be present on the remote host multiple times,
# -> not a big issue, just not clean, but it works
[ -e sshKey ] && [ -e sshKey.pub ] || generateKey
for remoteHost in "$@"
do
echo "$remoteHost"
deployKey "$remoteHost"
done
export SSH_AUTH_SOCK=/dev/null
|