A man has been jailed for six months after he punched the windows of a car at a petrol station in Greenock, before assaulting a constable at the town’s police office.