aboutsummaryrefslogtreecommitdiffstats
path: root/config/openbgpd/openbgpd.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-01-31 13:08:43 -0500
committerScott Ullrich <sullrich@pfsense.org>2010-01-31 13:09:08 -0500
commit482d151ddcd0f149d826da685c3f183cb422f8a0 (patch)
tree40dfd873cda6e2cb2741fd7e4f55e4aa420943f5 /config/openbgpd/openbgpd.inc
parent7fd76bd93723552b352f5ac66ca725804320cdc7 (diff)
downloadpfsense-packages-482d151ddcd0f149d826da685c3f183cb422f8a0.tar.gz
pfsense-packages-482d151ddcd0f149d826da685c3f183cb422f8a0.tar.bz2
pfsense-packages-482d151ddcd0f149d826da685c3f183cb422f8a0.zip
Adding patch from Aarno Aukia which fixes duplicate bgpd processes.
Diffstat (limited to 'config/openbgpd/openbgpd.inc')
-rw-r--r--config/openbgpd/openbgpd.inc6
1 files changed, 5 insertions, 1 deletions
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");