^No, there is actually a valve (for lack of a better term) made for this. You install it on the outgoing line of the gas meter, in a horizontal position.
The thing has a mechanism in it that will lock closed and stop gas flow when the magnatude (shaking) reaches a certain point. Don't remember exactly what it is but I think around 5.5.
Once is shuts, you have to go out to it and take a small tool and manually re-open it. The meter is out by the street so it lines break to the house, we don't get any explosions or fires. If it breaks before the meter, it's far enough away from the house that it won't impact the house.