summaryrefslogtreecommitdiff
path: root/update-openssh-known-hosts
diff options
context:
space:
mode:
authorTimo Weingärtner <timo@tiwe.de>2012-02-25 21:17:04 +0100
committerTimo Weingärtner <timo@tiwe.de>2012-02-25 21:17:04 +0100
commite5b99e36d96614d059137f3df323bcc39ead369e (patch)
tree67a3b5b716614514ee303fb7f9ec1173d04eafcf /update-openssh-known-hosts
parent550c2f513a05899566ca90a1e859218ee44a8ac7 (diff)
downloadopenssh-known-hosts-e5b99e36d96614d059137f3df323bcc39ead369e.tar.gz
Imported Debian version 0.4debian/0.4
Diffstat (limited to 'update-openssh-known-hosts')
-rwxr-xr-xupdate-openssh-known-hosts8
1 files changed, 6 insertions, 2 deletions
diff --git a/update-openssh-known-hosts b/update-openssh-known-hosts
index 63df1e3..00d74a6 100755
--- a/update-openssh-known-hosts
+++ b/update-openssh-known-hosts
@@ -84,9 +84,13 @@ run-parts --list "${CONFDIR}/sources/" | while read sourcefile; do
if [ -e ${source}/current ]; then
cat ${source}/current >&3
fi
-done 3>| "${OUTFILE}.new"
+done 3>&1 | sort -u >| "${OUTFILE}.new"
-mv "${OUTFILE}.new" "${OUTFILE}"
+if cmp -s "${OUTFILE}" "${OUTFILE}.new"; then
+ rm "${OUTFILE}.new"
+else
+ mv "${OUTFILE}.new" "${OUTFILE}"
+fi
# clean up cache dirs of vanished sources
for d in *; do