More BSD compat
This commit is contained in:
parent
85367b4b2f
commit
70e9936fd1
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# osync test suite 20161112002
|
# osync test suite 20161112003
|
||||||
|
|
||||||
# 4 tests:
|
# 4 tests:
|
||||||
# quicklocal
|
# quicklocal
|
||||||
|
@ -120,12 +120,14 @@ function SetConfFileValue () {
|
||||||
|
|
||||||
function SetupSSH {
|
function SetupSSH {
|
||||||
echo -e 'y\n'| ssh-keygen -t rsa -b 2048 -N "" -f "${HOME}/.ssh/id_rsa_local"
|
echo -e 'y\n'| ssh-keygen -t rsa -b 2048 -N "" -f "${HOME}/.ssh/id_rsa_local"
|
||||||
|
if ! grep "$(${HOME}/.ssh/id_rsa_local.pub)" "${HOME}/.ssh/authorized_keys"; then
|
||||||
cat "${HOME}/.ssh/id_rsa_local.pub" >> "${HOME}/.ssh/authorized_keys"
|
cat "${HOME}/.ssh/id_rsa_local.pub" >> "${HOME}/.ssh/authorized_keys"
|
||||||
|
fi
|
||||||
chmod 600 "${HOME}/.ssh/authorized_keys"
|
chmod 600 "${HOME}/.ssh/authorized_keys"
|
||||||
|
|
||||||
# Add localhost to known hosts so self connect works
|
# Add localhost to known hosts so self connect works
|
||||||
if [ -z $(ssh-keygen -F localhost) ]; then
|
if [ -z "$(ssh-keygen -F localhost)" ]; then
|
||||||
ssh-keyscan -H localhost >> ~/.ssh/known_hosts
|
ssh-keyscan -H localhost >> "${HOME}/.ssh/known_hosts"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue