Use coretemp to manage your cpu temp.
Maybe your computer shuts down cause your cpu is too hot (bad contact, or you need to change the thermal paste).
good tip..
just try to open the computer case and check if fan is turning...
maybe if your fan is full of dust, it don't turn... just use compressed air... to clean it...