summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-01-29 18:27:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-01-29 19:44:47 +0000
commit472060d9b1c119d4327e28f6a784971743d5b8e1 (patch)
treedeb3c74802b6167c92199b32ecd66a952a434ada
parentInstalling all available apt keys. (diff)
downloadprogress-linux-472060d9b1c119d4327e28f6a784971743d5b8e1.tar.xz
progress-linux-472060d9b1c119d4327e28f6a784971743d5b8e1.zip
Adding ssh_known_hosts handling.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/control1
-rwxr-xr-xdebian/progress-linux.postinst42
2 files changed, 37 insertions, 6 deletions
diff --git a/debian/control b/debian/control
index 7e55705..bcfd8d3 100644
--- a/debian/control
+++ b/debian/control
@@ -19,6 +19,7 @@ Depends:
apt-transport-https,
ca-certificates,
progress-linux-pgp-keys,
+ progress-linux-ssh-keys,
${misc:Depends},
Description: Progress Linux Setup
Progress Linux is a Debian derivative distribution focused on system
diff --git a/debian/progress-linux.postinst b/debian/progress-linux.postinst
index a6e613b..59e68c9 100755
--- a/debian/progress-linux.postinst
+++ b/debian/progress-linux.postinst
@@ -2,7 +2,7 @@
set -e
-Install ()
+Install_apt ()
{
# apt sources
echo "Installing /etc/apt/sources.list.d/progress-linux.list ..."
@@ -28,7 +28,7 @@ EOF
done
}
-Remove ()
+Remove_apt ()
{
# apt sources
echo "Removing /etc/apt/sources.list.d/progress-linux.list ..."
@@ -43,7 +43,7 @@ Remove ()
rm -f /etc/apt/trusted.gpg.d/progress-linux.gpg
}
-Configure ()
+Configure_apt ()
{
ARCHIVE="${1}"
@@ -71,6 +71,34 @@ Pin-Priority: 999
EOF
}
+Configure_ssh ()
+{
+ KEY="$(cat /usr/share/progress-linux/ssh-keys/ssh.progress-linux.org.pub)"
+
+ echo "Installing /etc/ssh/ssh_known_hosts ..."
+
+ if [ ! -e "/etc/ssh/ssh_known_hosts" ]
+ then
+ # ssh cert-authority
+ mkdir -p /etc/ssh
+
+cat > "/etc/ssh/ssh_known_hosts" << EOF
+# /etc/ssh/ssh_known_hosts
+
+@cert-authority *.progress-linux.org ${KEY}
+EOF
+
+ else
+ grep -v '^@cert-authority \*.progress-linux.org' /etc/ssh/ssh_known_hosts > /etc/ssh/ssh_known_hosts.tmp
+
+cat >> "/etc/ssh/ssh_known_hosts.tmp" << EOF
+@cert-authority *.progress-linux.org ${KEY}
+EOF
+
+ mv -f /etc/ssh/ssh_known_hosts.tmp /etc/ssh/ssh_known_hosts
+ fi
+}
+
case "${1}" in
configure)
. /usr/share/debconf/confmodule
@@ -85,9 +113,9 @@ case "${1}" in
if [ -n "${ARCHIVES}" ]
then
- Install
+ Install_apt
else
- Remove
+ Remove_apt
fi
ARCHIVES="$(echo ${ARCHIVES} | sed -e 's|, | |g')"
@@ -95,8 +123,10 @@ case "${1}" in
for ARCHIVE in ${ARCHIVES}
do
- Configure ${ARCHIVE}
+ Configure_apt ${ARCHIVE}
done
+
+ Configure_ssh
;;
abort-upgrade|abort-remove|abort-deconfigure)