summaryrefslogtreecommitdiff
path: root/debian/openssh-known-hosts.postinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/openssh-known-hosts.postinst')
-rw-r--r--debian/openssh-known-hosts.postinst10
1 files changed, 6 insertions, 4 deletions
diff --git a/debian/openssh-known-hosts.postinst b/debian/openssh-known-hosts.postinst
index 7caf740..0d810a9 100644
--- a/debian/openssh-known-hosts.postinst
+++ b/debian/openssh-known-hosts.postinst
@@ -20,10 +20,12 @@ set -e
case "$1" in
configure|abort-upgrade|abort-remove|abort-deconfigure)
- [ -e /etc/ssh/ssh_known_hosts ] || ln -s /var/lib/openssh-known-hosts/ssh_known_hosts /etc/ssh/ssh_known_hosts
- if [ "`readlink /etc/ssh/ssh_known_hosts`" != /var/lib/openssh-known-hosts/ssh_known_hosts ]; then
- echo "/etc/ssh/ssh_known_hosts already exists, please set up the link to"
- echo "/var/lib/openssh-known-hosts/ssh_known_hosts yourself or point to it"
+ kh_link=/etc/ssh/ssh_known_hosts
+ kh_dest=/var/lib/openssh-known-hosts/ssh_known_hosts
+ [ -L $kh_link ] || [ -e $kh_link ] || ln -s $kh_dest $kh_link
+ if [ "`readlink $kh_link`" != $kh_dest ]; then
+ echo "$kh_link already exists, please set up the link to"
+ echo "$kh_dest yourself or point to it"
echo "with GlobalKnownHostsFile in ssh_config(5)."
fi
;;