#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
	exit
fi
if (( $# != 1 )); then
	echo "usage: $0 <config-file>"
	exit 1
fi

LOGFILE="/var/www/raveberry_install_log_$(date +%Y-%m-%d-%H:%M:%S)"
pip3 install -U raveberry[install] >> "$LOGFILE" 2>&1
raveberry system-install --config-file "$1" --confirm-config >> "$LOGFILE" 2>&1
