From ca3d0996a98200b84d7cb6ca3cb105cd1c7d0931 Mon Sep 17 00:00:00 2001
From: gtxaspec <gtxent@gmail.com>
Date: Wed, 17 Jan 2024 03:32:15 -0800
Subject: [PATCH] make libimp_control optional load on ingenic with majestic
 (#1261)

---
 general/package/majestic/files/S95majestic | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/general/package/majestic/files/S95majestic b/general/package/majestic/files/S95majestic
index d853a739..aaf96fdb 100755
--- a/general/package/majestic/files/S95majestic
+++ b/general/package/majestic/files/S95majestic
@@ -19,7 +19,7 @@ load_majestic() {
 		ulimit -c unlimited && echo "|/usr/sbin/sendcoredump.sh" >/proc/sys/kernel/core_pattern
 	fi
 
-	if [ "ingenic" = "$(ipcinfo -v)" ]; then
+	if [ "ingenic" = "$(ipcinfo -v)" ] && [ -f /etc/webui/imp.conf ]; then
 		start-stop-daemon -b -m -S -q -p "$PIDFILE" -x /usr/bin/env -- \
 			LD_PRELOAD=/usr/lib/libimp_control.so $DAEMON_PATH/$DAEMON $DAEMON_ARGS
 	else