1 |
diff -Nur smeserver-yum-2.4.0/root/etc/e-smith/db/configuration/defaults/yum/CheckContribs smeserver-yum-2.4.0.bz8855/root/etc/e-smith/db/configuration/defaults/yum/CheckContribs |
2 |
--- smeserver-yum-2.4.0/root/etc/e-smith/db/configuration/defaults/yum/CheckContribs 1970-01-01 01:00:00.000000000 +0100 |
3 |
+++ smeserver-yum-2.4.0.bz8855/root/etc/e-smith/db/configuration/defaults/yum/CheckContribs 2015-02-21 15:20:54.982110115 +0100 |
4 |
@@ -0,0 +1 @@ |
5 |
+enabled |
6 |
diff -Nur smeserver-yum-2.4.0/root/etc/e-smith/db/configuration/migrate/Yum-remove-check4contribsupdates smeserver-yum-2.4.0.bz8855/root/etc/e-smith/db/configuration/migrate/Yum-remove-check4contribsupdates |
7 |
--- smeserver-yum-2.4.0/root/etc/e-smith/db/configuration/migrate/Yum-remove-check4contribsupdates 1970-01-01 01:00:00.000000000 +0100 |
8 |
+++ smeserver-yum-2.4.0.bz8855/root/etc/e-smith/db/configuration/migrate/Yum-remove-check4contribsupdates 2015-02-21 16:28:14.387219668 +0100 |
9 |
@@ -0,0 +1,11 @@ |
10 |
+{ |
11 |
+#Added for bug 8855 and bug 8858 |
12 |
+#we want to remove the property check4contribsupdates |
13 |
+ |
14 |
+ |
15 |
+my $check4contribsupdates = $DB->get_prop('yum','check4contribsupdates'); |
16 |
+ |
17 |
+if ($check4contribsupdates) { |
18 |
+ $DB->get('yum')->delete_prop('check4contribsupdates'); |
19 |
+ } |
20 |
+} |
21 |
diff -Nur smeserver-yum-2.4.0/root/etc/e-smith/templates/etc/crontab/check4contribsupdates smeserver-yum-2.4.0.bz8855/root/etc/e-smith/templates/etc/crontab/check4contribsupdates |
22 |
--- smeserver-yum-2.4.0/root/etc/e-smith/templates/etc/crontab/check4contribsupdates 1970-01-01 01:00:00.000000000 +0100 |
23 |
+++ smeserver-yum-2.4.0.bz8855/root/etc/e-smith/templates/etc/crontab/check4contribsupdates 2015-02-21 15:29:17.585570439 +0100 |
24 |
@@ -0,0 +1,25 @@ |
25 |
+{ |
26 |
+ return "\n# yum check for smecontribs updates is disabled\n" unless (($yum{status} eq 'enabled') && ($yum{CheckContribs} eq 'enabled')); |
27 |
+ |
28 |
+ my $freq = $yum{check4updates} || 'daily'; |
29 |
+ |
30 |
+ my $min; |
31 |
+ my $dom; |
32 |
+ my $dow; |
33 |
+ |
34 |
+ if ($freq eq 'weekly') { |
35 |
+ $min = 22; |
36 |
+ $dom = '*'; |
37 |
+ $dow = 0; |
38 |
+ } elsif ($freq eq 'monthly') { |
39 |
+ $min = 42; |
40 |
+ $dom = 1; |
41 |
+ $dow = '*'; |
42 |
+ } else { |
43 |
+ $min = 2; |
44 |
+ $dom = '*'; |
45 |
+ $dow = '*'; |
46 |
+ } |
47 |
+ return "$min 4 $dom * $dow root " |
48 |
+ . q{sleep $[ $RANDOM \\% 3600 ]; /sbin/e-smith/check4contribsupdates -m }; |
49 |
+} |
50 |
diff -Nur smeserver-yum-2.4.0/root/sbin/e-smith/check4contribsupdates smeserver-yum-2.4.0.bz8855/root/sbin/e-smith/check4contribsupdates |
51 |
--- smeserver-yum-2.4.0/root/sbin/e-smith/check4contribsupdates 1970-01-01 01:00:00.000000000 +0100 |
52 |
+++ smeserver-yum-2.4.0.bz8855/root/sbin/e-smith/check4contribsupdates 2015-02-21 15:18:57.521125460 +0100 |
53 |
@@ -0,0 +1,27 @@ |
54 |
+#! /bin/bash |
55 |
+ |
56 |
+mkdir -p /tmp/check4contribsupdates.$$ |
57 |
+TMPFILE=`mktemp /tmp/check4contribsupdates.$$/XXXXXXXXXX` || exit 1 |
58 |
+TMP1=`mktemp /tmp/check4contribsupdates.$$/XXXXXXXXXX` || exit 1 |
59 |
+ |
60 |
+MAILADDR=admin-yum |
61 |
+ |
62 |
+yum -e 0 -d 0 check-update --disablerepo=* --enablerepo=smecontribs > $TMP1 |
63 |
+if [ $? = 100 ]; then |
64 |
+ echo -e "===\n=== yum reports available updates for Contribs :\n===" >> $TMPFILE |
65 |
+ cat $TMP1 >> $TMPFILE |
66 |
+ echo -e "\n To apply all these updates, you can log on your server and run the following command :\n |
67 |
+ yum update --enablerepo=smecontribs\n" >> $TMPFILE |
68 |
+fi |
69 |
+ |
70 |
+if [ -s $TMPFILE ]; then |
71 |
+ if [ "$1" = "-m" ]; then |
72 |
+ mail -s "SME Server Contribs Updates available for `hostname`" $MAILADDR < $TMPFILE |
73 |
+ else |
74 |
+ echo "SME Server Contribs Updates available for `hostname`" |
75 |
+ cat $TMPFILE |
76 |
+ fi |
77 |
+fi |
78 |
+ |
79 |
+rm -f $TMPFILE $TMP1 |
80 |
+rm -fr /tmp/check4contribsupdates.* |