-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscsc.sh
executable file
·42 lines (38 loc) · 861 Bytes
/
scsc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
#
# Check for OS and store in $OS / $DIST
#
OS=$(uname -s)
if [ $OS = "SunOS" ];
then
OS=Solaris
elif [ $OS = "Linux" ];
then
if [ -f /etc/redhat-release ];
then
DIST="Redhat"
REV=$(cat /etc/redhat-release)
elif [ -f /etc/debian_version ];
then
DIST="Debian"
REV=$(cat /etc/debian_version)
fi
fi
if [ $OS != "Redhat" ];
then
echo "This script can only be used on CentOS / Red Hat"
exit 1
fi
if [ $(rpm -qa yum-changelog|wc -l) -lt 1 ];
then
echo -e "This script needs the yum-changelog package to function correctly, please install it using:\n yum install yum-changelog"
exit 1
fi
for i in $(yum check-update|awk '{print $1}'|tail -n+9);
do
result=$(echo n|yum --changelog update $i|grep -i cve|wc -l)
if [ $result -gt 0 ];
then
echo $i has security updates
fi
done