17 lines
425 B
Bash
17 lines
425 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
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
|
||
|
|
||
|
scp \
|
||
|
-i /etc/ixvd/secrets/ssh/keys/master/ixvd-master \
|
||
|
/etc/ixvd/secrets/ssh/keys/master/ixvd-master \
|
||
|
root@$1:.ssh/id_rsa
|
||
|
|
||
|
ssh \
|
||
|
-i /etc/ixvd/secrets/ssh/keys/master/ixvd-master \
|
||
|
root@$1 \
|
||
|
chmod 600 .ssh/id_rsa
|