Continuity of Government is a major theme of the book Jason
recommended a while back, Raven Rock. There were plenty of technically illegal orders placing various contingency plans in place putting (effectively) a military junta in a secret chain of succession. The problem that was eventually realized was that if the order is secret, how can anyone outside the group of people read in on it know whether it's a legitimate order or a coup d'etat?