#!/bin/sh
#****************************************************************#
# ScriptName: default/removeoldkernel.sh
# Author: xhy
# Create Date: 2020-03-22 12:10
# Modify Author: xhy
# Modify Date: 2020-03-22 12:10
# Version: 
#***************************************************************#
newkernel=`cat /proc/version | awk '{print $3}'`
oldkernel=`rpm -qa | grep kernel | grep -v "$newkernel"`
yum -y remove $oldkernel
yum clean all 
yum makecache
rm -rf /tmp/*
bash ./default/clean.sh
rm -rf ./initv*
rm -rf ./default
sed -i -e '/removeoldkernel/d' /etc/rc.d/rc.local
yum -y install git gcc gcc-c++ make wget openssh-clients bash-completion net-tools vim ntp screen lrzsz bash-completion-extras epel-release openssl
yum -y update
history -w
history -c
