Skip to content

Commit

Permalink
Merge pull request #316 from stigkj/handle_env_vars_with_space
Browse files Browse the repository at this point in the history
Handle environment vars. with space properly
  • Loading branch information
ddavison authored Oct 21, 2016
2 parents 4f8c67d + eaf72fb commit aabd14c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions StandaloneDebug/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ fi
rm -f /tmp/.X*lock

SERVERNUM=$(get_server_num)
env | cut -f 1 -d "=" | sort > asroot
sudo -E -u seluser -i env | cut -f 1 -d "=" | sort > asseluser

env | sort -k 1 -t '=' > asroot
sudo -E -u seluser -i env | sort -k 1 -t '=' > asseluser

# The .bash_aliases file will run when starting xvfb with the seluser below
join -v 1 -j 1 -t '=' --nocheck-order asroot asseluser > /home/seluser/.bash_aliases

sudo -E -i -u seluser \
$(for E in $(grep -vxFf asseluser asroot); do echo $E=$(eval echo \$$E); done) \
DISPLAY=$DISPLAY \
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
Expand Down

0 comments on commit aabd14c

Please sign in to comment.