#!/bin/bash

if [ -d /scripts ]
then
	cd /scripts
	DELLIST="`ls -l | grep suncast | tr -s \" \" | cut -d \" \" -f9`"
	if [ "$DELLIST" != "" ]
	then
		sudo rm $DELLIST
	fi
fi

if [ -d /etc/sudoers.d ]
then
	cd /etc/sudoers.d
	DELLIST="`ls -l | grep suncast | tr -s \" \" | cut -d \" \" -f9`"
	if [ "$DELLIST" != "" ]
	then
		sudo rm $DELLIST
	fi
fi

if [ -d /etc/ssh/sshd_config.d ]
then
	cd /etc/ssh/sshd_config.d
	DELLIST="`ls -l | grep suncast | tr -s \" \" | cut -d \" \" -f9`"
	if [ "$DELLIST" != "" ]
	then
		sudo rm $DELLIST
	fi
fi

if [ -d /etc/polkit-1/rules.d ]
then
        cd /etc/polkit-1/rules.d
        DELLIST="`ls -l | grep suncast | tr -s \" \" | cut -d \" \" -f9`"
        if [ "$DELLIST" != "" ]
        then
                sudo rm $DELLIST
        fi
fi


if [ -d /etc/apt/sources.list.d ]
then
	cd /etc/apt/sources.list.d/
	DELLIST="`ls -l | grep suncast | tr -s \" \" | cut -d \" \" -f9`"
	if [ "$DELLIST" != "" ]
	then
		sudo rm $DELLIST
	fi
fi

if [ -d /home/suncast/bin ]
then
	cd /home/suncast/bin
	DELLIST="`ls -l | grep suncast | tr -s \" \" | cut -d \" \" -f9`"
	if [ "$DELLIST" != "" ]
	then
		sudo rm $DELLIST
	fi
fi

if [ -d /home/suncast/.local/share/applications ]
then
	cd /home/suncast/.local/share/applications
	DELLIST="`ls -l | grep suncast | tr -s \" \" | cut -d \" \" -f9`"
	if [ "$DELLIST" != "" ]
	then
		sudo rm $DELLIST
	fi
fi

if [ -d /home/suncast/.config/autostart ]
then
	cd /home/suncast/.config/autostart
	DELLIST="`ls -l | grep suncast | tr -s \" \" | cut -d \" \" -f9`"
	if [ "$DELLIST" != "" ]
	then
		sudo rm $DELLIST
	fi
fi

if [ -f /etc/cron.d/suncast ]
then
	rm /etc/cron.d/suncast
fi
