Petr Lautrbach be68cc
#!/bin/bash
Petr Lautrbach be68cc
Petr Lautrbach be68cc
if [ ! -f /etc/selinux/config ]; then
Petr Lautrbach be68cc
    SELINUXTYPE=none
Petr Lautrbach be68cc
else
Petr Lautrbach be68cc
    source /etc/selinux/config
Petr Lautrbach be68cc
fi
Petr Lautrbach be68cc
Petr Lautrbach be68cc
cp -R --preserve=mode,ownership,timestamps,links /usr/share/selinux/$1/default/* /var/lib/selinux/$1
Petr Lautrbach be68cc
Petr Lautrbach be68cc
if selinuxenabled; then
Petr Lautrbach be68cc
    semodule -B -n
Petr Lautrbach be68cc
Petr Lautrbach be68cc
    if [ "$1" = "$SELINUXTYPE" ]; then
Petr Lautrbach be68cc
        reboot
Petr Lautrbach be68cc
    fi
Petr Lautrbach be68cc
fi