Implement time stamp and improve reporter syntax.
The directory access time used so far is modified on every ansible run and independent of the ansible module/playbook.
This commit is contained in:
parent
5ed4c2a135
commit
aa8bc09ce6
4 changed files with 25 additions and 13 deletions
|
@ -29,14 +29,14 @@ find_outdated(){
|
|||
while IFS= read -r -d '' file ; do
|
||||
running=$(( running + 1 ))
|
||||
$debug && echo -n "Processing host '$file' with IP address "
|
||||
d="$(sed -nE "s/\s+drwx.+([0-9]{4}-[0-9]{2}-[0-9]{2} \S+).*/\1/p" "$file" | head -1)"
|
||||
if [[ -z "$d" ]] || [[ $(date --date="$d" +%s) -lt $(date --date="$git_date" +%s) ]] ; then
|
||||
d="$(sed -nE "s/^2\s+(\S.+)$/\1/p" "$file")"
|
||||
if [[ -z "$d" ]] || \
|
||||
[[ $(date --date="$d" +%s) -lt $(date --date="$git_date" +%s) ]] ; then
|
||||
r='([0-9]{1,3}\.){3}[0-9]{1,3}'
|
||||
ipa="$(sed -nE "s|^\s+default via.+ src ($r) metric.+|\1|p" "$file" | head -1)"
|
||||
ipa="$(sed -nE "s/^3\s+default via.+ src ($r) metric.+/\1/p" "$file")"
|
||||
if [[ -z "$ipa" ]] ; then
|
||||
# FIXME: Outdated report format, trying fallback:
|
||||
ipa="$(grep -E "\s+2: en" -A3 "$file" | \
|
||||
sed -nE "s|.+inet (10\.190\.[[:digit:]]{1,3}\.[[:digit:]]{1,3})/.+|\1|p")"
|
||||
# FIXME: Outdated report format, try fallback:
|
||||
ipa="$(sed -nE "s|^.+default via.+ src ($r) metric.+|\1|p" "$file" | head -1)"
|
||||
fi
|
||||
$debug && echo "'$ipa'."
|
||||
if ! grep -q "$ipa" "$dir/${git_date//T*/}" ; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue