Pipeline systems in naval ships with special combat purposes (such as warships) are frequently exposed to the risk of damage. It is necessary to detect and isolate such unexpected damage quickly via an autonomous recovery system in the pipelines to ensure the ships survivability. This recovery system employs an autonomously controlled valve, which consists of a valve body, two pressure sensors, an actuator to open/close the valve, and a controller equipped with damage detection capability and a control algorithm. To enhance the reliability of the autonomous recovery system, this study first proposes a multistage control (MSC) algorithm that can comprehensively consider the various damage scenarios in a naval ship and then suggests the design procedure for the autonomous piping system based on support vector machine (SVM). To design the suggested algorithm, a simulation model for the one-dimensional real-time flow analysis is first established, and its results for possible damage scenarios are used as training data for the SVM with the valve operation information for recovery of the piping system and to minimize the damaged area. A performance comparison of the representative control algorithms for the autonomous piping system is conducted via flow simulations under three representative damage scenarios. Finally, a real-scale testbed of the firemain in a naval ship is designed and constructed, and the effectiveness of the algorithm is demonstrated through experiments.