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 other punishment as a court-martial may direct, but if the offense is committed at any other time, by punishment other than death as a court-martial may direct.