Any sentinel or look-out who is found drunk or sleeping upon his post, or leaves it before he is regularly relieved, shall be punished, if the offense is committed in time of war, by death or such other punishment as a court-martial may direct, but if the offense is committed at any other time, by such punishment other than death as a court-martial may direct.