From 482d151ddcd0f149d826da685c3f183cb422f8a0 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 31 Jan 2010 13:08:43 -0500 Subject: Adding patch from Aarno Aukia which fixes duplicate bgpd processes. --- config/openbgpd/openbgpd.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/openbgpd/openbgpd.inc b/config/openbgpd/openbgpd.inc index 4ad621e7..19ef8b43 100644 --- a/config/openbgpd/openbgpd.inc +++ b/config/openbgpd/openbgpd.inc @@ -153,7 +153,11 @@ function openbgpd_install_conf() { $fd = fopen("/usr/local/etc/rc.d/bgpd.sh","w"); fwrite($fd, "#!/bin/sh\n\n"); fwrite($fd, "# This file was created by the pfSense package manager. Do not edit!\n\n"); - fwrite($fd, "/usr/local/sbin/bgpd -f /usr/local/etc/bgpd.conf\n"); + fwrite($fd, "NUMBGPD=`ps auxw | grep bgpd | grep parent | grep -v grep | wc -l | awk '{print \$1}'`\n"); + fwrite($fd, "# echo \$NUMBGPD\n"); + fwrite($fd, "if [ \$NUMBGPD -lt 0 ] ; then\n"); + fwrite($fd, " /usr/local/sbin/bgpd -f /usr/local/etc/bgpd.conf\n"); + fwrite($fd, "fi\n"); fclose($fd); exec("chmod a+rx /usr/local/etc/rc.d/bgpd.sh"); exec("chmod a-rw /usr/local/etc/bgpd.conf"); -- cgit v1.2.3