File: selinux-basics.postinst

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 (33 lines) | stat: -rw-r--r-- 738 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
26
27
28
29
30
31
32
33
#!/bin/sh -e

case "$1" in
    configure)
    # only do this for the first install
    if [ -z "$2" ] || dpkg --compare-versions "$2" lt 0.2.5; then
        ln -s ../no-legacy-ptys.rules /etc/udev/rules.d/010-no-legacy-ptys.rules
    fi
    for n in /boot/grub/menu.lst /etc/default/grub ; do
      if [ -f $n ]; then
        if grep -q selinux=1 $n ; then
          if ! grep -q security=selinux $n ; then
            sed -e "s/selinux=1/selinux=1 security=selinux/" < $n > $n.new
            mv $n.new $n
          fi
        fi
        update-grub
      fi
    done
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
    echo "$0 called with unknown argument '$1'" >&2
    exit 1
    ;;
esac

#DEBHELPER#

exit 0