The document was an advertisement for Liberty Bonds during World War One that stated "Buy Liberty Bonds because if the Kaiser wins the war Good Night Shirt".
I have not been able to locate the phrase's origin or precise meaning. Does anyone know?
I think this might be hard to get a good source on, given its specificity and the simple fact that it is a very dated colloquial phrase. I was able to find little beyond this poem, which may not be of much help. There is also a mention of the phrase in this page, though I fear that may be even worse. It also appears here. A few others stated that their grandparents would exclaim it.
From what little evidence I can find, it seems that it may simply be a general indicator of surprise, or perhaps an acknowledgement of a result, like "Bob's your uncle!"