#!/bin/bash

display_usage() { 
	echo "Voeg het QGIS-NL profiel toe aan een bestaande QGIS 3.x installatie." 
	echo -e "\nUsage:\ninstall_QGIS-NL_profile.sh {default|additional} \n" 

	} 

if [  $# -lt 1 ] 
	then 
		display_usage
		exit 1
	fi 

if [[  $# == "--help" ||  $# == "-h" ]] 
	then 
		display_usage
		exit 0
	fi 
 
if [ "$1" == "default" ] 
    then
        echo "QGIS-NL is installed as default profile."
        echo "[core]" > "$HOME/.local/share/QGIS/QGIS3/profiles/profiles.ini"
        echo "defaultProfile=QGIS-NL" >> "$HOME/.local/share/QGIS/QGIS3/profiles/profiles.ini"
    fi

wget -qO- https://downloads.landgoed.support/qgis-nl/QGIS-NL.tar.gz | tar -xzvf - -C "$HOME/.local/share/QGIS/QGIS3/profiles/"



