Monitor and Restart Process
Write a shell script that monitors a process by name and restarts it if it exits. Log restart time into restart.log.
Constraints
- Use pgrep to detect running.
- If not running, restart and log.
- Loop with sleep 2.
- Use while true.
1#!/bin/bash2# TODO