游客发表

在CentOS/RHEL系统上生成补丁合规报告的Bash脚本

发帖时间:2025-11-04 13:57:29

在CentOS/RHEL系统上生成补丁合规报告的Bash脚本
复制#vi/opt/scripts/small-scripts/sec-errata.sh#!/bin/sh/tmp/sec-up.txtSUBJECT="Patching Reports on 系统"date""MESSAGE="/tmp/sec-up.txt"TO="[email protected]"echo"+---------------+-----------------------------+">> $MESSAGEecho"| Server_Name | Security Errata |">> $MESSAGEecho"+---------------+-----------------------------+">> $MESSAGEfor server in`more /opt/scripts/server.txt`dosec=`ssh $server yum updateinfo summary | grep Security | grep -v Important|Moderate | tail -1 | awk {print $1}`echo"$server $sec">> $MESSAGEdoneecho"+---------------------------------------------+">> $MESSAGEmail -s "$SUBJECT""$TO"< $MESSAGE1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.

    热门排行

    友情链接