I googled for a bit and it seems like ご機嫌よう/ごきげんよう ("gokigenyou") has both a greeting and a farewell meaning, but I couldn't find any etymology to explain it. Does it consist of any simpler parts, or is this a whole word/phrase? Why is it both a greeting and a farewell? I don't think there are other phrases like that but maybe I'm wrong about that.
Altogether means "your mood (being) well", or practically "in good mood; in good shape".
Why is it both a greeting and a farewell? I don't think there are other phrases like that but maybe I'm wrong about that.
Well... this word is pretty much analogous in many ways to "Good day!" in English. With the verb omitted, the phrase can stand for both "it is a good day" and "have a good day", thus has dual use as hello and goodbye.
† The inflection of adjectives is normally called declension, but in Japanese context I'm more comfortable to call it conjugation nevertheless.