File: selinux-config-enforcing

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 (18 lines) | stat: -rwxr-xr-x 570 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
set -e

MODE=$1
test "$MODE" = "0" && MODE=permissive

CONF=/etc/selinux/config

if [ "$MODE" = "permissive" ]; then
  sed -e "s/^SELINUX=.*$/SELINUX=permissive/" < $CONF > $CONF.new
  echo "Configured permissive mode in $CONF for the next boot."
  echo "This can be overridden by \"enforcing=1\" on the kernel command line."
else
  sed -e "s/^SELINUX=.*$/SELINUX=enforcing/" < $CONF > $CONF.new
  echo "Configured enforcing mode in $CONF for the next boot."
  echo "This can be overridden by \"enforcing=0\" on the kernel command line."
fi
mv $CONF.new $CONF