add new run_start.sh script

This commit is contained in:
Sam Detweiler 2019-12-10 08:29:18 -06:00
parent 87b48661fa
commit aea57ffaf4

View File

@ -7,19 +7,23 @@ if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty
fi fi
# get the processor architecture # get the processor architecture
arch=$(uname -m) arch=$(uname -m)
# got the config option, if any
serveronly=$(grep -i serveronly: config/config.js | awk '{print tolower($2)}' | tr -d ,\"\') # 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 # set default if not defined in config
serveronly="${serveronly:=false}" serveronly=${serveronly:-false}
# check for xwindows running # check for xwindows running
xorg=$(pgrep Xorg) xorg=$(pgrep Xorg)
#check for macOS
mac=$(uname)
# #
# if the user requested serveronly OR # if the user requested serveronly OR
# electron support for armv6l has been dropped OR # electron support for armv6l has been dropped OR
# system is in text mode # system is in text mode
# #
if [ "$serveronly." != "false." -o "$arch" == "armv6l" -o "$xorg." == "." ]; then if [ "$serveronly." != "false." -o "$arch" == "armv6l" ] || [ "$xorg." == "." -a $mac != 'Darwin' ]; then
# if user explicitly configured to run server only (no ui local) # if user explicitly configured to run server only (no ui local)
# OR there is no xwindows running, so no support for browser graphics # OR there is no xwindows running, so no support for browser graphics
if [ "$serveronly." == "true." -o "$xorg." == "." ]; then if [ "$serveronly." == "true." -o "$xorg." == "." ]; then
@ -58,5 +62,5 @@ if [ "$serveronly." != "false." -o "$arch" == "armv6l" -o "$xorg." == "." ]; t
fi fi
else else
# we can use electron directly # we can use electron directly
`electron js/electron.js $1`; electron js/electron.js $1;
fi fi