diff options
Diffstat (limited to 'security/openssh-portable/files/openssh.in')
-rw-r--r-- | security/openssh-portable/files/openssh.in | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/security/openssh-portable/files/openssh.in b/security/openssh-portable/files/openssh.in index 215095098a9f..230179312af1 100644 --- a/security/openssh-portable/files/openssh.in +++ b/security/openssh-portable/files/openssh.in @@ -35,11 +35,11 @@ pidfile=${openssh_pidfile:="/var/run/sshd.pid"} openssh_keygen() { - if [ -f %%ETCSSH%%/ssh_host_key -a \ - -f %%ETCSSH%%/ssh_host_dsa_key -a \ - -f %%ETCSSH%%/ssh_host_rsa_key -a \ - -f %%ETCSSH%%/ssh_host_ecdsa_key -a \ - -f %%ETCSSH%%/ssh_host_ed25519_key ]; then + if [ -f %%ETCDIR%%/ssh_host_key -a \ + -f %%ETCDIR%%/ssh_host_dsa_key -a \ + -f %%ETCDIR%%/ssh_host_rsa_key -a \ + -f %%ETCDIR%%/ssh_host_ecdsa_key -a \ + -f %%ETCDIR%%/ssh_host_ed25519_key ]; then return 0 fi @@ -49,49 +49,49 @@ openssh_keygen() [ -x %%PREFIX%%/bin/ssh-keygen ] || err 1 "%%PREFIX%%/bin/ssh-keygen does not exist." - if [ -f %%ETCSSH%%/ssh_host_key ]; then + if [ -f %%ETCDIR%%/ssh_host_key ]; then echo "You already have an RSA host key" \ - "in %%ETCSSH%%/ssh_host_key" + "in %%ETCDIR%%/ssh_host_key" echo "Skipping protocol version 1 RSA Key Generation" else %%PREFIX%%/bin/ssh-keygen -t rsa1 -b 1024 \ - -f %%ETCSSH%%/ssh_host_key -N '' + -f %%ETCDIR%%/ssh_host_key -N '' fi - if [ -f %%ETCSSH%%/ssh_host_dsa_key ]; then + if [ -f %%ETCDIR%%/ssh_host_dsa_key ]; then echo "You already have a DSA host key" \ - "in %%ETCSSH%%/ssh_host_dsa_key" + "in %%ETCDIR%%/ssh_host_dsa_key" echo "Skipping protocol version 2 DSA Key Generation" else %%PREFIX%%/bin/ssh-keygen -t dsa \ - -f %%ETCSSH%%/ssh_host_dsa_key -N '' + -f %%ETCDIR%%/ssh_host_dsa_key -N '' fi - if [ -f %%ETCSSH%%/ssh_host_rsa_key ]; then + if [ -f %%ETCDIR%%/ssh_host_rsa_key ]; then echo "You already have a RSA host key" \ - "in %%ETCSSH%%/ssh_host_rsa_key" + "in %%ETCDIR%%/ssh_host_rsa_key" echo "Skipping protocol version 2 RSA Key Generation" else %%PREFIX%%/bin/ssh-keygen -t rsa \ - -f %%ETCSSH%%/ssh_host_rsa_key -N '' + -f %%ETCDIR%%/ssh_host_rsa_key -N '' fi - if [ -f %%ETCSSH%%/ssh_host_ecdsa_key ]; then + if [ -f %%ETCDIR%%/ssh_host_ecdsa_key ]; then echo "You already have a Elliptic Curve DSA host key" \ - "in %%ETCSSH%%/ssh_host_ecdsa_key" + "in %%ETCDIR%%/ssh_host_ecdsa_key" echo "Skipping protocol version 2 Elliptic Curve DSA Key Generation" else %%PREFIX%%/bin/ssh-keygen -t ecdsa \ - -f %%ETCSSH%%/ssh_host_ecdsa_key -N '' + -f %%ETCDIR%%/ssh_host_ecdsa_key -N '' fi - if [ -f %%ETCSSH%%/ssh_host_ed25519_key ]; then + if [ -f %%ETCDIR%%/ssh_host_ed25519_key ]; then echo "You already have a Elliptic Curve ED25519 host key" \ - "in %%ETCSSH%%/ssh_host_ed25519_key" + "in %%ETCDIR%%/ssh_host_ed25519_key" echo "Skipping protocol version 2 Elliptic Curve ED25519 Key Generation" else %%PREFIX%%/bin/ssh-keygen -t ed25519 \ - -f %%ETCSSH%%/ssh_host_ed25519_key -N '' + -f %%ETCDIR%%/ssh_host_ed25519_key -N '' fi } @@ -105,20 +105,20 @@ openssh_check_same_ports(){ #check if opensshd-portable installed in replacement of base sshd - if [ "%%ETCSSH%%" = "/etc/ssh" ]; then + if [ "%%ETCDIR%%" = "/etc/ssh" ]; then return 1 fi self_port=$(awk '$1~/^ListenAddress/ \ {mlen=match($0,":[0-9]*$"); print \ - substr($0,mlen+1,length($0)-mlen)}' %%ETCSSH%%/sshd_config) + substr($0,mlen+1,length($0)-mlen)}' %%ETCDIR%%/sshd_config) if [ -z "$self_port" ]; then self_port=$(echo $openssh_flags | awk \ '{for (i = 1; i <= NF; i++) if ($i == "-p") \ {i++; printf "%s", $i; break; }; }') if [ -z "$self_port" ]; then self_port=$(awk '$1~/^Port/ {print $2}' \ - %%ETCSSH%%/sshd_config) + %%ETCDIR%%/sshd_config) fi fi # assume default 22 port |