/
serggt1
/
scripts
Обзор
Документация
Войти
/
serggt1
/
scripts
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
examples/check_script_is_running
17 строк
384 B
Sergey Ponomarev
check script is running example
23 дек 2014, 01:27
23 дек 2014, 01:27
b2c6a17
Код
Авторство
О чём код?
#!/bin/sh PIDFILE=/var/tmp/dbsync.pid if [ -e "$PIDFILE" ] ; then # our pidfile exists, let's make sure the process is still running though PID=`/bin/cat "$PIDFILE"` if /bin/kill -0 "$PID" > /dev/null 2>&1 ; then # indeed it is, i'm outta here! /bin/echo 'The script is still running, forget it!' exit 0 fi fi # ..... /bin/rm -f "$PIDFILE"