neb/tools/migration/initial-connection-to-server.sh
2023-10-30 01:00:50 +01:00

20 lines
No EOL
411 B
Bash
Executable file

#!/bin/bash
if ! [ "$(id -u)" = "0" ]; then
echo "please perform as root, attempting to escalate privileges..."
exec sudo $(cat /proc/$$/cmdline | sed 's/\x00/ /g')
exit 1
fi
if ! [ "$HOSTNAME" = "link" ]; then
echo "this should only be ran on link"
exit 1
fi
scp \
/etc/ixvd/secrets/ssh/keys/master/ixvd-master \
root@$1:.ssh/id_rsa
ssh \
root@$1 \
chmod 600 .ssh/id_rsa