Upstart stop if running Upstart stop if running bash bash

Upstart stop if running


A colleague came up with a great solution

if ( initctl status node-App | grep start ); then  initctl stop node-Appfi

Very simple and works properly when run from Jenkins


I'm using similar construction

initctl stop node-App || echo "node-App was not running"