From 5bb9bda2d378f5812b6b4d5402da97419fac9a87 Mon Sep 17 00:00:00 2001
From: Salt <rehashedsalt@cock.li>
Date: Fri, 21 Jun 2019 18:14:55 -0500
Subject: [PATCH] Fix firestarter killing itself because it exists

---
 firestarter | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/firestarter b/firestarter
index 1b98562..27707c6 100755
--- a/firestarter
+++ b/firestarter
@@ -274,8 +274,12 @@ https://gitlab.com/rehashedsalt/firestarter
 EOF
 }
 step_check() {
-	if pgrep firestarter > /dev/null 2>&1 && [ -z "$dryrun" ]; then
-		err "Firestarter is already running" 61
+	if [ -z "$dryrun" ]; then
+		for pid in $(pgrep firestarter); do
+			if [ "$pid" != "$BASHPID" ]; then
+				err "Firestarter is already running" 61
+			fi
+		done
 	fi
 	return 0
 }