#!/bin/sh

############change context of this file#################
echo "changing context of this file."
/usr/bin/chcon -t bin_t UNINSTALL
echo "Cleaning up /usr/share/segatex"
rm -rf /usr/share/segatex
echo "Removing symbolic link /usr/bin/segatex for /usr/bin/consolehelper"
rm /usr/bin/segatex
echo "Removing segatex binary /usr/sbin/segatex"
rm /usr/sbin/segatex
echo "Removing segatex pam file"
rm /etc/pam.d/segatex
rm /etc/security/console.apps/segatex
echo "Removing segatex desktop applications file"
rm /usr/share/applications/segatex-gui.desktop
echo "Removing segatex png file"
rm /usr/share/pixmaps/segatex-gui.png
############remove segatex related policies######################################
echo "Removing segatex.pp"
semodule -r segatex
echo "Removing auditcheck2.pp"
semodule -r auditcheck2
############restorcon directory and files of affected by segatex#################
#restorecon -R -v /usr/share
#echo "restoreconed /usr/share/segatex"
#restorecon -R -v /usr/sbin
#echo "restoreconed /usr/sbin"
#restorecon -R -v /usr/bin
#echo "restoreconed /usr/bin"
#echo 
############echo messages#################
echo "Uninstalled segatex related files !"
echo 
