From cb28e5fddc1a686867a103e50a34199052a764ab Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Fri, 22 Nov 2019 06:18:04 -0600 Subject: [PATCH] watch out for commented lines in config --- run-start.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/run-start.sh b/run-start.sh index a6c07520..cd32fda4 100755 --- a/run-start.sh +++ b/run-start.sh @@ -7,10 +7,12 @@ if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty fi # get the processor architecture arch=$(uname -m) -# got the config option, if any -serveronly=$(grep -i serveronly: config/config.js | awk '{print tolower($2)}' | tr -d ,\"\') +false='false' +# get the config option, if any +# only check non comment lines +serveronly=$(grep -v '^\s//' config/config.js | grep -i serveronly: | awk '{print tolower($2)}' | tr -d ,\"\') # set default if not defined in config -serveronly="${serveronly:=false}" +serveronly=${serveronly:-false} # check for xwindows running xorg=$(pgrep Xorg) # @@ -58,5 +60,5 @@ if [ "$serveronly." != "false." -o "$arch" == "armv6l" -o "$xorg." == "." ]; t fi else # we can use electron directly - `electron js/electron.js $1`; -fi \ No newline at end of file + electron js/electron.js $1; +fi