#!/bin/bash

shosts=`find / \( -path /.snapshots -o -path /sys -o -path /proc \) -prune -o -name '.shosts' -print 2>/dev/null`
shosts_equiv=`find /etc -name shosts.equiv -print 2>/dev/null`

set -e
fnames="$shosts $shosts_equiv"

if [ "x$fnames" != "x " ]; then
        echo "{\"changed\": true, \"removed\": \"$fnames\"}"
	if [ $# -eq 0 ]; then
	        rm -f $fnames
	fi
else
        echo "{\"changed\": false}"
fi

