/[smeserver]/rpms/smeserver-yum/sme8/smeserver-yum-2.2.0.check4updates_to_smecontribs.patch
ViewVC logotype

Contents of /rpms/smeserver-yum/sme8/smeserver-yum-2.2.0.check4updates_to_smecontribs.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Wed Nov 19 17:53:05 2014 UTC (10 years ago) by stephdl
Branch: MAIN
CVS Tags: smeserver-yum-2_2_0-24_el5_sme, smeserver-yum-2_2_0-23_el5_sme
* Wed Nov 19 2014 Stephane de Labrusse <stephdl@de-labrusse.fr> 2.2.0-23.sme
- Added a check-update for the smecontribs repository [SME: 8678]

1 diff -Nur smeserver-yum-2.4.0.old/root/etc/e-smith/templates/etc/crontab/check4contribsupdates smeserver-yum-2.4.0/root/etc/e-smith/templates/etc/crontab/check4contribsupdates
2 --- smeserver-yum-2.4.0.old/root/etc/e-smith/templates/etc/crontab/check4contribsupdates 1970-01-01 01:00:00.000000000 +0100
3 +++ smeserver-yum-2.4.0/root/etc/e-smith/templates/etc/crontab/check4contribsupdates 2014-11-19 17:59:47.540381038 +0100
4 @@ -0,0 +1,25 @@
5 +{
6 + return "\n# yum check for updates is disabled\n" unless $yum{status} eq 'enabled';
7 +
8 + my $freq = $yum{check4contribsupdates} || 'daily';
9 +
10 + my $min;
11 + my $dom;
12 + my $dow;
13 +
14 + if ($freq eq 'weekly') {
15 + $min = 22;
16 + $dom = '*';
17 + $dow = 0;
18 + } elsif ($freq eq 'monthly') {
19 + $min = 42;
20 + $dom = 1;
21 + $dow = '*';
22 + } else {
23 + $min = 2;
24 + $dom = '*';
25 + $dow = '*';
26 + }
27 + return "$min 4 $dom * $dow root "
28 + . q{sleep $[ $RANDOM \\% 3600 ]; /sbin/e-smith/check4contribsupdates -m };
29 +}
30 diff -Nur smeserver-yum-2.4.0.old/root/sbin/e-smith/check4contribsupdates smeserver-yum-2.4.0/root/sbin/e-smith/check4contribsupdates
31 --- smeserver-yum-2.4.0.old/root/sbin/e-smith/check4contribsupdates 1970-01-01 01:00:00.000000000 +0100
32 +++ smeserver-yum-2.4.0/root/sbin/e-smith/check4contribsupdates 2014-11-19 17:58:02.709057486 +0100
33 @@ -0,0 +1,27 @@
34 +#! /bin/bash
35 +
36 +mkdir -p /tmp/check4contribsupdates.$$
37 +TMPFILE=`mktemp /tmp/check4contribsupdates.$$/XXXXXXXXXX` || exit 1
38 +TMP1=`mktemp /tmp/check4contribsupdates.$$/XXXXXXXXXX` || exit 1
39 +
40 +MAILADDR=admin-yum
41 +
42 +yum -e 0 -d 0 check-update --disablerepo=* --enablerepo=smecontribs > $TMP1
43 +if [ $? = 100 ]; then
44 + echo -e "===\n=== yum reports available updates for Contribs :\n===" >> $TMPFILE
45 + cat $TMP1 >> $TMPFILE
46 + echo -e "\n To apply all these updates, you can log on your server and run the following command :\n
47 + yum update --enablerepo=smecontribs\n" >> $TMPFILE
48 +fi
49 +
50 +if [ -s $TMPFILE ]; then
51 + if [ "$1" = "-m" ]; then
52 + mail -s "SME Server Contribs Updates available for `hostname`" $MAILADDR < $TMPFILE
53 + else
54 + echo "SME Server Contribs Updates available for `hostname`"
55 + cat $TMPFILE
56 + fi
57 +fi
58 +
59 +rm -f $TMPFILE $TMP1
60 +rm -fr /tmp/check4contribsupdates.*

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed