#!/bin/bash if [[ ! -f /vagrant/localconfig ]]; then echo "missing localconfig" exit 1 fi if [[ ! -f /vagrant/data/params ]]; then echo "missing data/params" exit 1 fi if grep -q "'urlbase' => ''" /vagrant/data/params; then echo "urlbase not configured" exit 1; fi if grep -q '$db_host.*localhost' /vagrant/localconfig; then echo "\$db_host not configured" exit 1 fi for file in /vagrant/data/params /vagrant/index.cgi; do info="$(stat -c %U.%G "$file")" if [[ $info != "vagrant.apache" ]]; then echo "wrong file owner: $info $file" exit 1 fi done cd /vagrant sudo -u apache perl -T index.cgi &>/tmp/index.html || exit 1 grep -q skin-Dusk /tmp/index.html && exit 1 rm /tmp/index.html exit 0