File: selinux-policy-upgrade

package info (click to toggle)
selinux-basics 0.5.0
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 140 kB
  • sloc: python: 279; sh: 217; perl: 43; makefile: 26
file content (25 lines) | stat: -rwxr-xr-x 468 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
set -e

if [ "$1" != "" ]; then
  SELINUXTYPE="$1"
else
  . /etc/selinux/config
fi

cd /usr/share/selinux/$SELINUXTYPE

echo "Updating \"$SELINUXTYPE\" policy"

# remove obsolete modules
for n in procmail tmpreaper ; do
  semodule -l |grep -q $n && semodule -r $n
done

semodule -b base.pp $(for n in $(semodule -s $SELINUXTYPE -l | cut -f1); do
  if [ -e $n.pp ]; then
    echo -n " -i $n.pp"
  fi
done
semodule -l|grep -q dkim && echo -n " -i milter.pp"
)