check_trip script