#!/bin/bash

version=6.7.1

wget -O /var/cache/pi-apps/Geekbench6.tar.gz https://cdn.geekbench.com/Geekbench-${version}-LinuxARMPreview.tar.gz
tar -xf /var/cache/pi-apps/Geekbench6.tar.gz -C /var/cache/pi-apps || error "Failed to extract files!"
rm -f /var/cache/pi-apps/Geekbench6.tar.gz ./Geekbench6.tar.gz
sudo mv -f /var/cache/pi-apps/Geekbench-${version}-LinuxARMPreview /opt/geekbench6 || error "Failed to move source folder to /opt!"

# Create symbolic link
sudo ln -sf /opt/geekbench6/geekbench_aarch64 /usr/local/bin/geekbench6 || error "Failed to create symbolic link to /usr/local/bin!"
