#!/bin/sh
VER_NUM=`cat /etc/issue | grep -iE "Ubuntu 1(5|6|7|8|9)\.|Debian GNU/Linux (9|10|11) " | wc -l` ;

ps -ef|grep DynamsoftService|grep -v grep|grep -v uninstall|cut -c 9-15|xargs kill -9 

rm -rf /etc/rcS.d/*DynamsoftServiced
rm -rf /etc/init.d/DynamsoftServiced


if [ $VER_NUM -ne 0 ]; then
	systemctl stop dynamsoft.service
	systemctl disable dynamsoft.service
	systemctl daemon-reload
fi


rm -rf /usr/bin/DynamsoftServiceMgr
rm -rf /usr/bin/DynamsoftCertCheckMgr
rm -rf /opt/dynamsoft/DynamsoftService

sed -i '/DynamsoftService/d'  /etc/profile
dpkg -r DynamsoftService
