#!/bin/bash
set -e

if pidof uos-ai-assistant; then
   killall uos-ai-assistant
fi

if [ "$1" = "remove" ] || [ "$1" = "purge" ] ; then
    string=`who -q`
    array=(${string// / })  
    if [ -d "/home/"${array[0]}"/.local/share/deepin" ];then
        cd /home/"${array[0]}"/.local/share/deepin
        if [ -d "uos-ai-assistant" ]; then
            rm -fr "uos-ai-assistant"
        fi
    fi
fi
