I had a similar problem when I first got my truck. Everything went bad in a few months. I replaced fuel pump, filter, plugs/wires, and ecu. All those were bad and when replaced it ran for another 2 weeks then did the cut off thing. Drive me nuts for a while then I have in and gave it to a local mechanic. It made him crazy but eventually he found the problem, a plastic connector had burned up. All he did was cut it out and solder the wires thru, ran great since then.