﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
475,[openssh] Move _progress call into if blocks in sshd_keymaker.sh,diver,scottmc,"See r1188.
Move _progress call into if blocks to prevent notification in case ssh keys was already in place, e.g. via UserBuildConfig:
{{{
ExtractArchiveToHaikuImage common settings :   $(HAIKU_TOP)/ssh_keys.zip ;
}}}

Alternatively we can check if ${SETTINGSSSHDIR} exist end exit, not sure which way is better. 

Original sshd_keymaker.sh:
{{{
#!/bin/sh

_progress () {
        notify --type progress --app ssh-keygen \
                --icon /boot/system/kernel_x86 \
                --messageID $0_$$ \
                --title ""Generating ssh keys..."" \
                --progress ""$1"" ""$2"" >/dev/null
}

# generate SSH host keys

SETTINGSSSHDIR=`finddir B_COMMON_SETTINGS_DIRECTORY`/ssh
mkdir -p ${SETTINGSSSHDIR}

hostKeyDir=${SETTINGSSSHDIR}

_progress 0.0 ""rsa1""
if [ ! -f ""$hostKeyDir/ssh_host_key"" ] ; then
        ssh-keygen -t rsa1 -f ""$hostKeyDir/ssh_host_key"" -N """"
fi

_progress 0.3 ""dsa""
if [ ! -f ""$hostKeyDir/ssh_host_dsa_key"" ] ; then
        ssh-keygen -t dsa -f ""$hostKeyDir/ssh_host_dsa_key"" -N """"
fi

_progress 0.6 ""rsa""
if [ ! -f ""$hostKeyDir/ssh_host_rsa_key"" ] ; then
        ssh-keygen -t rsa -f ""$hostKeyDir/ssh_host_rsa_key"" -N """"
fi

_progress 1.0 """"
}}}

Modified sshd_keymaker.sh:
{{{
#!/bin/sh

_progress () {
        notify --type progress --app ssh-keygen \
                --icon /boot/system/kernel_x86 \
                --messageID $0_$$ \
                --title ""Generating ssh keys..."" \
                --progress ""$1"" ""$2"" >/dev/null
}

# generate SSH host keys

SETTINGSSSHDIR=`finddir B_COMMON_SETTINGS_DIRECTORY`/ssh
mkdir -p ${SETTINGSSSHDIR}

hostKeyDir=${SETTINGSSSHDIR}

if [ ! -f ""$hostKeyDir/ssh_host_key"" ] ; then
        _progress 0.0 ""rsa1""
        ssh-keygen -t rsa1 -f ""$hostKeyDir/ssh_host_key"" -N """"
fi

if [ ! -f ""$hostKeyDir/ssh_host_dsa_key"" ] ; then
        _progress 0.3 ""dsa""
        ssh-keygen -t dsa -f ""$hostKeyDir/ssh_host_dsa_key"" -N """"
fi

if [ ! -f ""$hostKeyDir/ssh_host_rsa_key"" ] ; then
        _progress 0.6 ""rsa""
        ssh-keygen -t rsa -f ""$hostKeyDir/ssh_host_rsa_key"" -N """"
        _progress 1.0 """"
fi

}}}",enhancement,closed,normal,,net-misc/openssh,,normal,fixed,,
