if [ "$1" = "remove" ]; then
   cscli dashboard remove -f -y --error || echo "Ignore the above error if you never installed the local dashboard."
   systemctl stop crowdsec
   systemctl disable crowdsec
fi

if [ "$1" = "upgrade" ]; then
   systemctl stop crowdsec
fi