1#!/bin/bash 2# 3# Script to setup a GCE instance to run the webtry server. 4# For full instructions see the README file. 5sudo apt-get install schroot debootstrap monit squid3 6sudo apt-get install g++ libfreetype6 libfreetype6-dev libpng12-0 libpng12-dev libglu1-mesa-dev mesa-common-dev freeglut3-dev libgif-dev libfontconfig libfontconfig-dev 7 8echo "Adding the webtry user account" 9sudo adduser webtry 10 11sudo cp continue_install /home/webtry/continue_install 12sudo chmod 766 /home/webtry/continue_install 13sudo chown webtry:webtry /home/webtry/continue_install 14sudo su webtry -c /home/webtry/continue_install 15 16sudo mkdir -p /srv/chroot/webtry 17sudo cp /home/webtry/skia/experimental/webtry/sys/webtry_schroot /etc/schroot/chroot.d/webtry 18 19sudo mkdir /srv/chroot/webtry/etc 20sudo mkdir /srv/chroot/webtry/bin 21sudo cp /bin/sh /srv/chroot/webtry/bin/sh 22 23# Copy all the dependent libraries into the schroot. 24sudo cp --parents `ldd /home/webtry/skia/out/Debug/webtry | cut -d " " -f 3` /srv/chroot/webtry 25sudo cp --parents `ldd /bin/sh | cut -d " " -f 3` /srv/chroot/webtry 26 27sudo cp /home/webtry/skia/experimental/webtry/sys/webtry_init /etc/init.d/webtry 28sudo cp /home/webtry/skia/experimental/webtry/sys/webtry_monit /etc/monit/conf.d/webtry 29sudo cp /home/webtry/skia/experimental/webtry/sys/webtry_squid /etc/squid3/squid.conf 30sudo chmod 744 /etc/init.d/webtry 31 32# Confirm that monit is happy. 33sudo monit -t 34