Skip to content

Instantly share code, notes, and snippets.

@jnikolak
Last active April 21, 2017 06:47
Show Gist options
  • Save jnikolak/8f0365dcba1cd04a14804d1a53ee863b to your computer and use it in GitHub Desktop.
Save jnikolak/8f0365dcba1cd04a14804d1a53ee863b to your computer and use it in GitHub Desktop.
Rhel Updater Project
### First version 0.000001
#!/bin/bash
# confirm version Rhel 5, 6, 7 and switch version and commands based upon this. For test purposes this is for Rhel 6
########## RHEL 6 ###########################################
# Verify rpm
cd /var/lib/rpm
/usr/lib/rpm/rpmdb_verify Packages
# Checking yum for updates, we'll add warnings later, this will also confirm if we cannot to the repositories
yum check-update > /tmp/check-update.out
# Disabling of all third party repos, its done for epel, work out a way to find other repos that may conflict.
epel=$(yum repolist enabled -v | grep epel | grep Repo-filename | awk '{print $2}')
sed -i -e "s/^enabled=1/enabled=0/" $epel
# Lets force an fsck upon a reboot
cd /;touch /forcefsck;reboot
# Checking for Network Drivers ( Red Hat and non Red Hat)
# --> I've add a way to get ethtool status, but now need to work on a way to verify if drivers will survive an update
intName=$(ip link | egrep -v "lo|link" | awk -F ': ' '{print $2}')
arr=($intName)
for i in "${arr[@]}";do ethtool -i $i;printf "\n";done
This data could then output if (non redhat)
This data could also be run against big-data to find any other compatability issues.
# Checking for Storage Drivers ( Red Hat and non Red Hat)
##############################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment