diff options
author | D. Johnson <fenris02@fedoraproject.org> | 2011-12-02 01:31:12 -0600 |
---|---|---|
committer | D. Johnson <fenris02@fedoraproject.org> | 2011-12-02 01:31:12 -0600 |
commit | 3d8908ab208bbaf878334275768f7b53700d99c8 (patch) | |
tree | 458c6946fc27ce95cf4686f57c34e651eee57a04 /reset-selinux.sh | |
parent | 80ae382b7592cea3043f6586711da7d564909088 (diff) | |
download | cleanup-3d8908ab208bbaf878334275768f7b53700d99c8.tar.gz cleanup-3d8908ab208bbaf878334275768f7b53700d99c8.tar.xz cleanup-3d8908ab208bbaf878334275768f7b53700d99c8.zip |
reordering deps
Diffstat (limited to 'reset-selinux.sh')
-rwxr-xr-x[-rw-r--r--] | reset-selinux.sh | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/reset-selinux.sh b/reset-selinux.sh index a3f4bef..4a1f71a 100644..100755 --- a/reset-selinux.sh +++ b/reset-selinux.sh @@ -1,21 +1,32 @@ #!/bin/bash +# Partial script version of http://fedorasolved.org/Members/fenris02/post_upgrade_cleanup + +DS=$(/bin/date +%Y%d%m) LANG=C -DS=$(date +%Y%d%m) -TMPDIR=/root/tmp +TMPDIR=$(/bin/mktemp -d ${TMPDIR:-/tmp}/${0##*/}-XXXXX.log) [ -d "${TMPDIR}" ] || mkdir -p "${TMPDIR}" -[ -x /usr/sbin/semanage ] || yum install -y policycoreutils-python +if [ "$(/usr/bin/whoami)" != "root" ]; then + echo "Must be run as root." + exit 1 +fi + [ -x /usr/sbin/setenforce ] || yum install -y libselinux-utils +/usr/sbin/setenforce 0 -setenforce 0 -semanage -o ${TMPDIR}/SELINUX-CUSTOM-CONFIG_${DS}.txt +[ -x /usr/sbin/semanage ] || yum install -y policycoreutils-python +/usr/sbin/semanage -o ${TMPDIR}/SELINUX-CUSTOM-CONFIG_${DS}.txt -mv /etc/selinux/targeted ${TMPDIR}/targeted.${DS} -install -d -m 0755 -o root -g root /etc/selinux/targeted -yum reinstall -y selinux-policy{,-targeted} policycoreutils{,-newrole,-restorecond,-sandbox} +/bin/mv /etc/selinux/targeted ${TMPDIR}/targeted.${DS} +/usr/bin/install -d -m 0755 -o root -g root /etc/selinux/targeted +/usr/bin/yum reinstall -y \ + libselinux{,-python,utils} \ + policycoreutils{,-newrole,-restorecond,-sandbox} \ + selinux-policy{,-targeted} \ + # -semanage -i ${TMPDIR}/SELINUX-CUSTOM-CONFIG_${DS}.txt -setenforce 1 +/usr/sbin/semanage -i ${TMPDIR}/SELINUX-CUSTOM-CONFIG_${DS}.txt +/usr/sbin/setenforce 1 #EOF |