Skip to content

Commit f50fb64

Browse files
committed
Update install.sh
made chromium-finding smarter
1 parent edf5270 commit f50fb64

1 file changed

Lines changed: 25 additions & 15 deletions

File tree

install.sh

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,31 @@ if [ $os == "Linux" ]; then
2929

3030
#install chromium from source if not available via apt-get
3131
# Raspbian Jesse does not include chromium in apt-get
32-
if ! dpkg -s chromium; then
33-
# Raspbian Jesse does not have chromium in its repositories
34-
# adapted from https://medium.com/@icebob/jessie-on-raspberry-pi-2-with-docker-and-chromium-c43b8d80e7e1#6afd
35-
# files from https://launchpad.net/ubuntu/+source/chromium-browser/
36-
# download files
37-
cfile=$(mktemp)
38-
wget https://launchpad.net/~canonical-chromium-builds/+archive/ubuntu/stage/+build/8883797/+files/chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb -O $cfile
39-
fffile=$(mktemp)
40-
wget https://launchpad.net/~canonical-chromium-builds/+archive/ubuntu/stage/+build/8883797/+files/chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb -O $fffile
41-
# install
42-
sudo dpkg -i $fffile $cfile
43-
# symbolic link
44-
sudo ln -s /usr/bin/chromium-browser /usr/bin/chromium
45-
#clean up
46-
rm $cfile $fffile
32+
# if chromium is not where we expect it
33+
if ! ls /usr/bin/chromium; then
34+
# if chromium is available somewhere else, symlink to it
35+
if which chromium; then
36+
sudo ln -s `which chromium` /usr/bin/chromium
37+
# if chromium-browser is available somwhere, symlink to it
38+
elif which chromium-browser; then
39+
sudo ln -s `which chromium-browser` /usr/bin/chromium
40+
# otherwise we need to download and install chromium
41+
else
42+
# Raspbian Jesse does not have chromium in its repositories
43+
# adapted from https://medium.com/@icebob/jessie-on-raspberry-pi-2-with-docker-and-chromium-c43b8d80e7e1#6afd
44+
# files from https://launchpad.net/ubuntu/+source/chromium-browser/
45+
# download files
46+
cfile=$(mktemp)
47+
wget https://launchpad.net/~canonical-chromium-builds/+archive/ubuntu/stage/+build/8883797/+files/chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb -O $cfile
48+
fffile=$(mktemp)
49+
wget https://launchpad.net/~canonical-chromium-builds/+archive/ubuntu/stage/+build/8883797/+files/chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb -O $fffile
50+
# install
51+
sudo dpkg -i $fffile $cfile
52+
# symbolic link
53+
sudo ln -s `which chromium-browser` /usr/bin/chromium
54+
#clean up
55+
rm $cfile $fffile
56+
fi
4757
fi
4858

4959
# TODO: update chromium window_placement settings

0 commit comments

Comments
 (0)