PREUN
/bin/sh
if [ "$1" -lt "1" ] ; then
# Disable the policy and restart the daemon
/usr/sbin/setsebool xpilotd_disable_trans 1 &> /dev/null || :
/sbin/service xpilot-ng-server condrestart > /dev/null 2>&1 || :
# Unload the module
/usr/sbin/semanage port -d -t xpilotd_port_t -p udp 15345 &> /dev/null || :
/usr/sbin/semanage port -d -t xpilotd_port_t -p udp 32200-32299 &> /dev/null || :
for variant in targeted ; do
/usr/sbin/semodule -s ${variant} -r xpilotd &> /dev/null || :
done
# Set the context back
/sbin/fixfiles -R xpilot-ng-server restore || :
fi
POSTIN
/bin/sh
# Install SELinux policy modules
for selinuxvariant in targeted
do
/usr/sbin/semodule -s ${selinuxvariant} -i \
/usr/share/selinux/${selinuxvariant}/xpilotd.pp &> /dev/null || :
done
/usr/sbin/semanage port -a -t xpilotd_port_t -p udp 15345 &> /dev/null || :
/usr/sbin/semanage port -a -t xpilotd_port_t -p udp 32200-32299 &> /dev/null || :
/sbin/fixfiles -R xpilot-ng-server restore || :
/sbin/service xpilot-ng-server condrestart > /dev/null 2>&1 || :
POSTUN
/bin/sh
if [ "$1" -ge "1" ] ; then
# Replace the module if it is already loaded. semodule -u also
# checks the module version
for variant in targeted ; do
/usr/sbin/semodule -u /usr/share/selinux/${variant}/xpilotd.pp || :
done
fi