Skip to content

Commit

Permalink
Add check to skip yum clean all on RHEL
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth Thomas committed Oct 19, 2015
1 parent ca861e2 commit d01cb1d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion scripts/centos/cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
#!/bin/sh -eux

if [ -s /etc/oracle-release ]; then
distro = 'oracle'
elif [ -s /etc/enterprise-release ]; then
distro = 'oracle'
elif [ -s /etc/redhat-release ]; then
# should ouput 'centos' OR 'red hat'
distro=`cat /etc/redhat-release | sed 's/^\(CentOS\|Red Hat\).*/\1/i' | tr '[:upper:]' '[:lower:]'`
fi


# Remove development and kernel source packages
yum -y remove gcc cpp kernel-devel kernel-headers perl;
yum -y clean all;

if [ "$distro" != 'red hat' ]; then
yum -y clean all;
fi

# Clean up network interface persistence
rm -f /etc/udev/rules.d/70-persistent-net.rules;
Expand Down

0 comments on commit d01cb1d

Please sign in to comment.