add detection of xwindows running

This commit is contained in:
Sam Detweiler 2019-10-25 06:22:10 -05:00
parent 0677d0a810
commit c8849a17b6

View File

@ -11,14 +11,18 @@ arch=$(uname -m)
serveronly=$(grep -i serveronly: config/config.js | awk '{print tolower($2)}' | tr -d ,\"\')
# set default if not defined in config
serveronly="${serveronly:=false}"
# check for xwindows running
xorg=$(pgrep Xorg)
#
# if the user requested serveronly OR
# electron support for armv6l has been dropped
# electron support for armv6l has been dropped OR
# system is in text mode
#
if [ "$serveronly." != "false." -o "$arch" == "armv6l" ]; then
if [ "$serveronly." != "false." -o "$arch" == "armv6l" -o "$xorg." == "." ]; then
# if user explicitly configured to run server only (no ui local)
if [ "$serveronly." == "true." ]; then
# OR there is no xwindows running, so no support for browser graphics
if [ "$serveronly." == "true." -o "$xorg." == "." ]; then
# start server mode,
node serveronly
else