2017-02-22 00:58:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-05-24 02:49:25 +00:00
|
|
|
set -ex
|
2017-02-22 00:58:30 +00:00
|
|
|
|
|
|
|
OUT=${1:-headless_shell}
|
|
|
|
VER=$2
|
|
|
|
|
|
|
|
if [ -z "$VER" ]; then
|
|
|
|
VER=$(curl -s https://storage.googleapis.com/docker-chrome-headless/latest.txt|sed -e 's/^headless_shell-//' -e 's/\.tar\.bz2$//')
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p $OUT
|
|
|
|
|
|
|
|
pushd $OUT &> /dev/null
|
|
|
|
|
|
|
|
curl -s https://storage.googleapis.com/docker-chrome-headless/headless_shell-$VER.tar.bz2 | tar -jxv
|
|
|
|
|
2017-05-24 02:49:25 +00:00
|
|
|
./headless_shell --remote-debugging-port=8222 &
|
|
|
|
|
2017-09-03 01:41:27 +00:00
|
|
|
HEADLESS_PID=$!
|
|
|
|
|
2017-05-24 02:49:25 +00:00
|
|
|
sleep 1
|
|
|
|
|
|
|
|
curl -v -q http://localhost:8222/json/version
|
|
|
|
|
2017-09-03 01:41:27 +00:00
|
|
|
kill -9 $HEADLESS_PID
|
2017-05-24 02:49:25 +00:00
|
|
|
|
2017-02-22 00:58:30 +00:00
|
|
|
popd &> /dev/null
|