#!/bin/bash

echo Starting demo installation on proverif16.paris.inria.fr

echo Initializing opam
. /home/ROCQ/prosecco/bblanche/.opam/opam-init/variables.sh

echo Creating directories
sudo mkdir -p /var/www/html/bin
sudo mkdir -p /var/www/html/tmpfiles

echo Unpacking the archive
tar -xzf proverifdemo.tgz
# Initially, I am in the home directory, cd to the proverif directory
cd proverif
echo Building ProVerif
./build
echo Copying files
sudo cp proverif /var/www/html/bin
sudo cp -r cssproverif.css demo/examples demo/index.php /var/www/html
cd /var/www/html
sudo chown www-data:www-data * bin/* examples/* examples/*/*
