If a sheriff is legally removed from office or dies or resigns before the expiration of the term for which the sheriff was commissioned, the chief deputy sheriff shall:
(1) execute the office of sheriff and perform all duties required by the office of sheriff; and
(2) receive and retain the compensation provided by law for sheriffs until another sheriff is commissioned and notice is given to the chief deputy sheriff.