Someone
public shellscript v1 · immutable#!/bin/bash# esto debe ir al inittab:# test:2345:respawn:/ruta/al/ejecutable/asterisk >/dev/tty3 2>&1 </dev/tty3# 3:23:off:/sbin/getty 38400 tty3proceso='asterisk'checar=`ps aux | grep -c $proceso`if [ $checar -gt 1 ]; then# si esta corriendo el proceso se hace esto#matarid=`ps aux | grep $proceso | awk '{print $2}' | head -1`#kill -9 $mataridkillall $procesoelse# si no, se hace esto otro exit 0fi