Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #4

Merged
merged 4 commits into from
Aug 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion tinyssh_install
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,37 @@ display_fingerprints() {
generate_keys() {
if [ ! -d /etc/tinyssh/sshkeydir ]; then
tinysshd-makekey /etc/tinyssh/sshkeydir
if [ $? -eq 0 ]; then
echo "Generated tinyssh keys..."
return 0
fi
fi
return 1
}

copy_openssh_keys() {
local osshed25519="/etc/ssh/ssh_host_ed25519_key"

local destdir="/etc/tinyssh/sshkeydir"

local return_code=1

if [ ! -d $destdir -a -x /usr/bin/tinyssh-convert ]; then
mkdir $destdir
fi

if [ -s "$osshed25519" -a ! -s $destdir/.ed25519.sk -a ! -s $destdir/ed25519.pk -a -x /usr/bin/tinyssh-convert ]; then
tinyssh-convert -f $osshed25519 -d $destdir
if [ $? -eq 0 ]; then
return_code=0
fi
fi

if [ $return_code -eq 0 ]; then
echo "Converted keys from OpenSSH..."
fi

return $return_code
}

create_systemd_customdep () {
Expand Down Expand Up @@ -41,7 +71,7 @@ build ()

umask 0022

generate_keys
copy_openssh_keys || generate_keys
display_fingerprints

#systemd enabled
Expand Down