Farmer admits unleashing rifle on thief