<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.defcon-cc.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Mail_bei_YUM_Updates</id>
	<title>Mail bei YUM Updates - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.defcon-cc.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Mail_bei_YUM_Updates"/>
	<link rel="alternate" type="text/html" href="https://www.defcon-cc.org/wiki/index.php?title=Mail_bei_YUM_Updates&amp;action=history"/>
	<updated>2026-05-24T21:36:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.defcon-cc.org/wiki/index.php?title=Mail_bei_YUM_Updates&amp;diff=753&amp;oldid=prev</id>
		<title>Webmaster: Created page with &quot;Ich habe mehrere Server im Betrieb für die ich ein BASH-Skript benötigt habe das mich informiert wenn neue YUM Updates  zu verfügung stehen. Ich möchte hier mit euch das BASH-Skript teilen:  == Skript == &lt;syntaxhighlight lang=&quot;c&quot;&gt; #!/bin/bash EMAIL=&quot;admin@example.com&quot; STATE_FILE=&quot;/tmp/update_count.state&quot;  # Execute yum check-update and capture the output  UPDATES=$(yum check-update --quiet 2&gt;/dev/null)  # Filter out empty lines and count the number of updates  UPDATE...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.defcon-cc.org/wiki/index.php?title=Mail_bei_YUM_Updates&amp;diff=753&amp;oldid=prev"/>
		<updated>2025-02-02T10:33:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Ich habe mehrere Server im Betrieb für die ich ein BASH-Skript benötigt habe das mich informiert wenn neue YUM Updates  zu verfügung stehen. Ich möchte hier mit euch das BASH-Skript teilen:  == Skript == &amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt; #!/bin/bash EMAIL=&amp;quot;admin@example.com&amp;quot; STATE_FILE=&amp;quot;/tmp/update_count.state&amp;quot;  # Execute yum check-update and capture the output  UPDATES=$(yum check-update --quiet 2&amp;gt;/dev/null)  # Filter out empty lines and count the number of updates  UPDATE...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Ich habe mehrere Server im Betrieb für die ich ein BASH-Skript benötigt habe das mich informiert wenn neue YUM Updates &lt;br /&gt;
zu verfügung stehen. Ich möchte hier mit euch das BASH-Skript teilen:&lt;br /&gt;
&lt;br /&gt;
== Skript ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
EMAIL=&amp;quot;admin@example.com&amp;quot;&lt;br /&gt;
STATE_FILE=&amp;quot;/tmp/update_count.state&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Execute yum check-update and capture the output &lt;br /&gt;
UPDATES=$(yum check-update --quiet 2&amp;gt;/dev/null)&lt;br /&gt;
&lt;br /&gt;
# Filter out empty lines and count the number of updates &lt;br /&gt;
UPDATES=$(echo &amp;quot;$UPDATES&amp;quot; | grep -v &amp;quot;^$&amp;quot;) &lt;br /&gt;
UPDATES_COUNT=$(echo -n &amp;quot;$UPDATES&amp;quot; | wc -l)&lt;br /&gt;
&lt;br /&gt;
# Read the previous update count, if any&lt;br /&gt;
if [[ -f &amp;quot;$STATE_FILE&amp;quot; ]]; then&lt;br /&gt;
    PREVIOUS_COUNT=$(cat &amp;quot;$STATE_FILE&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
    PREVIOUS_COUNT=0&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Compare update counts&lt;br /&gt;
if [[ $UPDATES_COUNT -ne $PREVIOUS_COUNT ]]; then&lt;br /&gt;
    echo &amp;quot;$UPDATES&amp;quot; | mail -s &amp;quot;Updates for $(hostname): ${UPDATES_COUNT}&amp;quot; &amp;quot;$EMAIL&amp;quot;&lt;br /&gt;
    # Update the state file with the new count&lt;br /&gt;
    echo &amp;quot;$UPDATES_COUNT&amp;quot; &amp;gt; &amp;quot;$STATE_FILE&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Webmaster</name></author>
	</entry>
</feed>