fix run-start.sh: if running in docker-container, just start electron, see #1859

This commit is contained in:
Karsten Hassel 2020-01-03 19:12:02 +01:00
parent 69a887fb05
commit 20a9150ea3
2 changed files with 67 additions and 58 deletions

View File

@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Force declaration of public ip adress in config file (ISSUE #1852)
- Fixes `run-start.sh`: If running in docker-container, don't check the environment, just start electron (ISSUE #1859)
### Updated

View File

@ -2,28 +2,35 @@
# use bash instead of sh
./untrack-css.sh
if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty
export DISPLAY=:0 # Set by default display
fi
# get the processor architecture
arch=$(uname -m)
false='false'
if grep docker /proc/1/cgroup -qa; then
# if running in docker, only start electron
# 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}
# check for xwindows running
xorg=$(pgrep Xorg)
#check for macOS
mac=$(uname)
#
# if the user requested serveronly OR
# electron support for armv6l has been dropped OR
# system is in text mode
#
if [ "$serveronly." != "false." -o "$arch" == "armv6l" ] || [ "$xorg." == "." -a $mac != 'Darwin' ]; then
electron js/electron.js $1;
else
# not running in docker
if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty
export DISPLAY=:0 # Set by default display
fi
# get the processor architecture
arch=$(uname -m)
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}
# check for xwindows running
xorg=$(pgrep Xorg)
#check for macOS
mac=$(uname)
#
# if the user requested serveronly OR
# electron support for armv6l has been dropped OR
# system is in text mode
#
if [ "$serveronly." != "false." -o "$arch" == "armv6l" ] || [ "$xorg." == "." -a $mac != 'Darwin' ]; then
# if user explicitly configured to run server only (no ui local)
# OR there is no xwindows running, so no support for browser graphics
@ -61,7 +68,8 @@ if [ "$serveronly." != "false." -o "$arch" == "armv6l" ] || [ "$xorg." == "."
chromium-browser -noerrdialogs -kiosk -start_maximized --disable-infobars --app=http://localhost:$port --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors 2>/dev/null
exit
fi
else
else
# we can use electron directly
electron js/electron.js $1;
fi
fi