diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2013-06-12 13:55:43 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2013-06-12 13:56:16 +0000 |
commit | ed6da5f2a59f971c3f340becc4a2f0fa6d430a0e (patch) | |
tree | ddd16180c7bc141ef3610ae95cc9f9b5e8ecc293 /testing/opennebula/opennebula.initd | |
parent | 51cfe949cfb6c29c257fdbbddcaf07779f2c16b9 (diff) | |
download | aports-ed6da5f2a59f971c3f340becc4a2f0fa6d430a0e.tar.bz2 aports-ed6da5f2a59f971c3f340becc4a2f0fa6d430a0e.tar.xz |
testing/opennebula: various fixes
Diffstat (limited to 'testing/opennebula/opennebula.initd')
-rw-r--r-- | testing/opennebula/opennebula.initd | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/opennebula/opennebula.initd b/testing/opennebula/opennebula.initd index d80d3753d..0da109904 100644 --- a/testing/opennebula/opennebula.initd +++ b/testing/opennebula/opennebula.initd @@ -8,6 +8,8 @@ depend() { } start() { + checkconfig || return 1 + ebegin "Starting OpenNebula daemon" start-stop-daemon \ --start \ @@ -42,3 +44,17 @@ stop() { --pidfile "${SCHED_PIDFILE}" eend $? } + +gen_key() { + ebegin "Generating ssh key" + su - ${USER} -c "ssh-keygen -q -t dsa -N '' -f ${HOME}/.ssh/id_dsa" + cp -p "${HOME}/.ssh/id_dsa.pub" "${HOME}/.ssh/authorized_keys" + eend $? +} + +checkconfig() { + if [ ! -f "${HOME}/.ssh/id_dsa" ] ; then + gen_key || return 1 + fi +} + |