---
 yum-cron/yum-cron.sysconfig |    3 +++
 yum-cron/yum-update.cron.sh |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/yum-cron/yum-cron.sysconfig b/yum-cron/yum-cron.sysconfig
index 4c8c40d..3b7134d 100644
--- a/yum-cron/yum-cron.sysconfig
+++ b/yum-cron/yum-cron.sysconfig
@@ -72,6 +72,9 @@ RANDOMWAIT=60
 # day.
 #DAYS_OF_WEEK="0123456" 
 
+# Set this to only update if the domainname of the machine matches this
+#DNSDOMAINNAME=
+
 # The cleanup task (which clears the package cache) can run on a subset
 # of the days above. (If the value chosen here doesn't appear in
 # DAYS_OF_WEEK, the cleanup task will never happen.)
diff --git a/yum-cron/yum-update.cron.sh b/yum-cron/yum-update.cron.sh
index b9edddf..eebea22 100755
--- a/yum-cron/yum-update.cron.sh
+++ b/yum-cron/yum-update.cron.sh
@@ -24,6 +24,11 @@ fi
 # the setting in the sysconfig file.
 [[ $RANDOMWAIT -gt 0 ]] && sleep $(( $RANDOM % ($RANDOMWAIT * 60) + 1 ))
 
+# Only run if we are on the correct domain
+if [ -n "$DNSDOMAINNAME" -a "$DNSDOMAINNAME" != "$(awk '$1 == "domain" { print 
$2 } ' /etc/resolv.conf)" ]; then
+  exit 0
+fi
+
 # Double-check to make sure that we're still supposed to be 
 # active after the random wait.
 if [[ ! -f /var/lock/subsys/yum-cron ]]; then
-- 
1.7.7.6

_______________________________________________
Yum-devel mailing list
Yum-devel@lists.baseurl.org
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to