#!/bin/sh -e
###
# This script will install the dependencies for running Signet. It can be run
# as a normal user who has sudo or doas access, or as root.
###
os=`uname`
if [ "$os" = "Linux" ]; then
	me=`whoami`
	sudo=""
	if [ "$me" != "root" ]; then
		# We need to do a priv esc
		failed=0
		which sudo && sudo=`which sudo` || true
		which doas && sudo=`which doas` || true
		if [ -z "$sudo" ]; then
			echo "Error: Not running as root and couldn't find sudo nor doas"
			exit 1
		fi
	fi
	$sudo apt-get update
	$sudo apt-get install -y libqt5x11extras5 libqt5websockets5 libykpers-1-dev
else
	echo "Platform not yet implemented"
fi
