Horje
bash only start a service if not running Code Example
bash only start a service if not running
#!/bin/bash
service=replace_me_with_a_valid_service

if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 ))
then
echo "$service is running!!!"
else
/etc/init.d/$service start
fi




Shell

Related
shell script runner software for linux Code Example shell script runner software for linux Code Example
bash regex match space Code Example bash regex match space Code Example
powershell format table sort Code Example powershell format table sort Code Example
how set php version for composer in ubuntu Code Example how set php version for composer in ubuntu Code Example
no matching manifest for linux/arm64/v8 in the manifest list entries Code Example no matching manifest for linux/arm64/v8 in the manifest list entries Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11