check if hosts file exists before testing removed hosts
This commit is contained in:
parent
eb6c24c12b
commit
8342535886
|
@ -79,6 +79,7 @@ finish() {
|
|||
trap finish EXIT
|
||||
|
||||
# Test if removed hosts are still online.
|
||||
if [ -f hosts ]; then
|
||||
echo "Testing removed hosts..."
|
||||
for removed_host in $(diff hosts "$tempfile" | grep ^\< | cut -c 3-); do
|
||||
printf "%s" "$removed_host"
|
||||
|
@ -93,6 +94,7 @@ $removed_host"
|
|||
echo " - offline"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Sort entries again.
|
||||
hosts=$(echo "$hosts" | sort)
|
||||
|
|
Loading…
Reference in New Issue