Check if process is running if not then use command

Hello,

Could someone do the following bash ubuntu script for me? I have 5 screen processes of bot:

SCREEN -dmS Xbot_instance_1 php core.php -i 1

SCREEN -dmS Xbot_instance_2 php core.php -i 2

SCREEN -dmS Xbot_instance_3 php core.php -i 3

SCREEN -dmS Xbot_instance_4 php core.php -i 4

SCREEN -dmS Xbot_instance_5 php core.php -i 5

When one of those screens will be off then script will restart it by command

./restart.sh restart

Anyone can help me?

Welcome to the forum.

Almost certainly. But - you'll benefit more if you try yourself, and ask here if you get stuck. So, please show your attempts so far, the reasoning behind, and the errors / fails you encounter, in detail.

Welcome to the forum.

Almost certainly. But - you'll benefit more if you try yourself, and ask here if you get stuck. So, please show your attempts so far, the reasoning behind, and the errors / fails you encounter, in detail.