kurtcms / daemonc

IP Networking: Execute if Process is Missing

Home Page:https://kurtcms.org/networking-execute-if-process-is-missing/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IP Networking: Execute if Process is Missing

This Bash script may be executed on a terminal or by a task scheduler such as cron and it does the following:

  1. Execute ps to print a snapshot of the current processes;
  2. Match the print with grep to see if the argument supplied is found in the current processes; and
  3. If the argument supplied is not found, execute it.

A detailed walk-through is available here.

Table of Content

Getting Started

Get started in three simple steps:

  1. Download a copy of the script;
  2. Provide the script with execute permission; and
  3. Run the script.

Git Clone

Download a copy of the script with git clone.

$ git clone https://github.com/kurtcms/daemonc /app/daemonc/

Permission

Provide the script with execute permission.

$ chmod +x /app/daemonc/daemonc.sh

Run

Run the script with an executable process and its corresponding argument(s) as arguments(s).

$ /app/daemonc/daemonc.sh iperf -s -D

And have the output of the supplied executable process returned, or have nothing returned if it is found in the current processes.

Running Iperf Server as a daemon

About

IP Networking: Execute if Process is Missing

https://kurtcms.org/networking-execute-if-process-is-missing/

License:GNU General Public License v2.0


Languages

Language:Shell 100.0%