#!/bin/bash

version=3_4_3

cd /tmp
wget -O renoise-armhf.tar.gz "https://files.renoise.com/demo/Renoise_${version}_Demo_Linux_armhf.tar.gz" || exit 1
status "Extracting Renoise..."
tar -xf renoise-armhf.tar.gz || error "Failed to extract Renoise!"
cd Renoise_${version}_Demo_Linux_armhf || error "Failed to cd into 'Renoise_${version}_Demo_Linux_armhf'!"
status_green "Done!"
status "Installing Renoise..."
chmod +x install.sh || error "Failed to set 'install.sh' as execuable!"
sudo ./install.sh
if [ "$?" == "1" ]; then
  status_green "Done!"  
elif [ "$?" == "0" ]; then
  error "Failed to install Renoise with 'install.sh'"
else
  warning "Unknown status code... Renoise may or may not have installed successfully."
fi
status "Cleaning up..."
cd ../
rm -rf Renoise_${version}_Demo_Linux_armhf renoise-armhf.tar.gz
status_green "Done!"
