#!/bin/bash

DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"

function error {
  echo -e "\\e[91m$1\\e[39m"
  exit 1
}

cd $HOME
#remove deb if present
rm -f ./qemu*-armhf.deb
#Download QEMU
wget https://github.com/chunky-milk/qemu-arm-builds/releases/download/6.0.50/qemu-6.0.50-armhf.deb || error 'Failed to Download QEMU!'
#Install QEMU
sudo apt install -fy ./qemu-6.0.50-armhf.deb || error 'Failed to install QEMU!'
rm -f qemu-6.0.50-armhf.deb
