#!/bin/bash
set -e

if [[ "$1" = "0" || "$1" = "remove" || "$1" = "purge" ]]; then
    # Suppress output of the uninstall command
    echo "Running uninstall command..." >/dev/null 2>&1
    /opt/IDriveForLinux/resources/app.asar.unpacked/IdriveForLinux/idriveforlinux.bin --uninstall desktop-app >/dev/null 2>&1 || echo "Uninstall command failed." >/dev/null 2>&1
fi

# Redirect script's final output to /dev/null
exit 0 >/dev/null 2>&1
