#!/bin/sh dir=$(dirname "$0") cd $dir APP="http_logger" PID=$(ps -o pid= -C $APP | sed 's/^[ \t]*//') if [ -z "$PID" ]; then nohup ./$APP & PID=$(ps -o pid= -C $APP | sed 's/^[ \t]*//') echo "Процесс $APP был запущен ($PID)." else echo "Процесс $APP уже запущен ($PID)." fi