summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2012-12-04 10:08:05 -0500
committerScott Moser <smoser@ubuntu.com>2012-12-04 10:08:05 -0500
commit375995c9bd3e9d1794395f471d2215c58b7f2453 (patch)
treedebc9ea79d10798217c17abfc349b1934638f6a7
parent1e7b96743314f566814848ad05c5bc7271a5de91 (diff)
parent75d991b2e807d8bf26a2b94791870b86c43a1c96 (diff)
downloadvyos-cloud-init-375995c9bd3e9d1794395f471d2215c58b7f2453.tar.gz
vyos-cloud-init-375995c9bd3e9d1794395f471d2215c58b7f2453.zip
write-ssh-key-fingerprints: use logger -s rather than --stderr
--stderr would be preferred for readability, but older versions of logger do not support the long form. Use the short form for compatibility. LP: #1083715
-rw-r--r--ChangeLog2
-rwxr-xr-xtools/write-ssh-key-fingerprints15
2 files changed, 14 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c02334a9..fbfd3385 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@
- make sure there is no blank line before cloud-init entry in
there are no blank lines in /etc/ca-certificates.conf (LP: #1077020)
- fix sudoers writing when entry is a string (LP: #1079002)
+ - tools/write-ssh-key-fingerprints: use '-s' rather than '--stderr'
+ option (LP: #1083715)
0.7.1:
- sysvinit: fix missing dependency in cloud-init job for RHEL 5.6
- config-drive: map hostname to local-hostname (LP: #1061964)
diff --git a/tools/write-ssh-key-fingerprints b/tools/write-ssh-key-fingerprints
index aa1f3c38..6c3451fd 100755
--- a/tools/write-ssh-key-fingerprints
+++ b/tools/write-ssh-key-fingerprints
@@ -1,5 +1,14 @@
#!/bin/sh
+
+logger_opts="-p user.info -t ec2"
+
+# rhels' version of logger_opts does not support long
+# for of -s (--stderr), so use short form.
+logger_opts="$logger_opts -s"
+
+# Redirect stderr to stdout
exec 2>&1
+
fp_blist=",${1},"
key_blist=",${2},"
{
@@ -16,9 +25,9 @@ done
echo "-----END SSH HOST KEY FINGERPRINTS-----"
echo "#############################################################"
-} | logger -p user.info --stderr -t "ec2"
+} | logger $logger_opts
-echo -----BEGIN SSH HOST KEY KEYS-----
+echo "-----BEGIN SSH HOST KEY KEYS-----"
for f in /etc/ssh/ssh_host_*key.pub; do
[ -f "$f" ] || continue
read ktype line < "$f"
@@ -26,4 +35,4 @@ for f in /etc/ssh/ssh_host_*key.pub; do
[ "${key_blist#*,$ktype,}" = "${key_blist}" ] || continue
cat $f
done
-echo -----END SSH HOST KEY KEYS-----
+echo "-----END SSH HOST KEY KEYS-----"