Update SFC project dependencies
[releng/builder.git] / vagrant / rackspace-convert-base / bootstrap.sh
1 #!/bin/bash
2
3 # vim: ts=4 sw=4 sts=4 et :
4
5 # Handle the occurance where SELINUX is actually disabled
6 if [ `grep SELINUX=permissive /etc/selinux/config` ]; then
7     # make sure that the filesystem is properly labelled.
8     # it could be not fully labeled correctly if it was just switched
9     # from disabled, the autorelabel misses some things
10     # skip relabelling on /dev as it will generally throw errors
11     restorecon -R -e /dev /
12
13     # enable enforcing mode from the very start
14     setenforce enforcing
15
16     # configure system for enforcing mode on next boot
17     sed -i 's/SELINUX=permissive/SELINUX=enforcing/' /etc/selinux/config
18 else
19     sed -i 's/SELINUX=disabled/SELINUX=permissive/' /etc/selinux/config
20     touch /.autorelabel
21
22     echo "*******************************************"
23     echo "** SYSTEM REQUIRES A RESTART FOR SELINUX **"
24     echo "*******************************************"
25 fi
26
27 yum clean all -q
28 yum update -y -q