From 2fa8ec7f39ed8f3d21bd1f9e55add695aa2b2de6 Mon Sep 17 00:00:00 2001
From: Daniil Baturin <daniil@baturin.org>
Date: Sun, 14 Apr 2019 12:08:47 +0200
Subject: T1273: shorten the debug check.

---
 scripts/vyatta-boot-config-loader | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/scripts/vyatta-boot-config-loader b/scripts/vyatta-boot-config-loader
index b445d9e..b242b78 100755
--- a/scripts/vyatta-boot-config-loader
+++ b/scripts/vyatta-boot-config-loader
@@ -16,13 +16,12 @@ do_log () {
 
 do_commit () {
   # Check if debug is enabled in the kernel command line
-  if [ ! grep vyos-debug /proc/cmdline > /dev/null ]; then
-    debug=""
+  grep vyos-debug /proc/cmdline > /dev/null
+  if [ $? == 0 ]; then
+    VYOS_DEBUG=$debug $COMMIT "$@" >>$COMMIT_LOG
   else
-    debug="yes"
+    $COMMIT "$@" >>$COMMIT_LOG
   fi
-
-  VYOS_DEBUG=$debug $COMMIT "$@" >>$COMMIT_LOG
 }
 
 trace () {
-- 
cgit v1.2.3