PC Shutdown/Startup controller

Hello I am trying to figure out how to program a way to start and shutdown a car pc by pulsing the motherboard header pin. My arduino would be powered all the time and I was going to use a double throw relay at 5v so that when I turn the ignition on the relay would send 5v to one pin to pulse the header then when I shut it off it would send 5v to another pin to pulse the header. I don't want the script to loop because it would just keep pulsing the header. I don't know if I need to do an if else statement or button state or what. I am pretty rough when it comes to programming.

I don't want the script to loop because it would just keep pulsing the header.

Have the code controlled by if statements.

if pcRunning is false
  code to read car ignition voltage and start the PC if the ignition is on
  set pcRunning to true
end if
  code to read car ignition voltage and stop the PC if the ignition is off
  set pcRunning to false
end else

A car is a pretty rough electrical environment so it may not be simple to get this working.

Will I be able to make this constantly monitored. Like should I loop this code or do I have it run every time I turn the key on.

Put it in the loop() function. You said that you intended to keep the Arduino running, which may not be a great idea due to battery drain. If the Arduino is not to be kept running then I don't see the need for it anyway. Just use a toggle switch to power the PC on/off. Either way, how are you going to deal with shutting down the PC nicely rather than simply turning it off when commanded ?

Well for the battery draw issue I have a separate 12v system for the carpc issue so I am not worried about that as for the pc shutdown I have it set so when the motherboard header is pulsed it puts the computer in hibernapuyte mode for faster startup. I know I can go the momentary pushbutton way but I want this basically to function as a normal head unit. Here is what I'm trying to reproduce with the arduino. http://store.mp3car.com/Micro_Shutdown_Controller_p/pwr-007.htm