summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2015-04-21 17:32:07 +0200
committerAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2015-04-21 17:32:07 +0200
commite505d27bf36a7377c40ce1199490350ad57a522e (patch)
tree6a615bafb023e296d97f9788807803cd3532384e
parentaf1432b44ffd859c33d0aaedf070c2d3b745cb00 (diff)
downloadbcfg2-tools-e505d27bf36a7377c40ce1199490350ad57a522e.tar.gz
bcfg2-tools-e505d27bf36a7377c40ce1199490350ad57a522e.tar.bz2
bcfg2-tools-e505d27bf36a7377c40ce1199490350ad57a522e.zip
check-hosts: Cleanup removed hosts
Remove orphaned stale hosts state files for removed hosts.
-rwxr-xr-xcheck-hosts4
1 files changed, 2 insertions, 2 deletions
diff --git a/check-hosts b/check-hosts
index e629bab..6c7dcfd 100755
--- a/check-hosts
+++ b/check-hosts
@@ -40,8 +40,8 @@ get_stale_once() {
)
done
- comm -13 <(get_stale | sort) <(get_all | sort) | while read host; do
- STALE_FILE="${STALE_DIR}/${host}"
+ comm -23 <(ls -1 ${STALE_DIR}/ | sort) <(get_all | sort) | while read file; do
+ STALE_FILE="${STALE_DIR}/${file}"
test -f "${STALE_FILE}" && rm -f "${STALE_FILE}"
done
}