Last change
on this file since 2274 was
2274,
checked in by achernya, 12 years ago
|
Set locale to C so sort produces consistent results for rpm-sync
|
-
Property svn:executable set to
*
|
File size:
1.2 KB
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | export LC_ALL=C |
---|
4 | |
---|
5 | echo "Entering correct directory..." |
---|
6 | mkdir -p /mit/scripts/cron_scripts/rpm-sync/ |
---|
7 | cd /mit/scripts/cron_scripts/rpm-sync/ |
---|
8 | |
---|
9 | echo "Cleaning up environment..." |
---|
10 | rm -rf *.rpmlist *.diff rpmlist.master missing.rpms |
---|
11 | |
---|
12 | servers=`finger @scripts-director.mit.edu | grep "\->" | grep EDU | awk '{print $2}' | cut -d: -f1 | sort | uniq` |
---|
13 | |
---|
14 | for server in $servers; do |
---|
15 | echo "Connecting to $server..." |
---|
16 | { ssh $server /mit/scripts/sbin/rpmlist.sh 2>&1 >&3 | grep -Fxv 'If you have trouble logging in, see http://scripts.mit.edu/faq/41/.'; } 3>&1 >&2 |
---|
17 | done |
---|
18 | |
---|
19 | echo "Creating master package list..." |
---|
20 | cat *.rpmlist | sort | uniq > rpmlist.master |
---|
21 | |
---|
22 | echo "Comparing scripts servers to overall rpm list..." |
---|
23 | touch missing.rpms |
---|
24 | for server in *.rpmlist; do |
---|
25 | diff -U3 $server rpmlist.master > $server.diff |
---|
26 | serverPretty=`basename $server .rpmlist` |
---|
27 | echo "Server $serverPretty is missing:" >> missing.rpms |
---|
28 | grep "^+[^+]" $server.diff | cut -b 1 --complement >> missing.rpms |
---|
29 | echo >> missing.rpms |
---|
30 | done |
---|
31 | |
---|
32 | if [ `egrep -c -v '(missing)|(^$)' missing.rpms` -gt 0 ]; then |
---|
33 | echo "Sending email..." |
---|
34 | cat missing.rpms | mail -s "scripts.mit.edu servers are out of sync" root@scripts.mit.edu |
---|
35 | else |
---|
36 | echo "No email needs to be sent! scripts.mit.edu is up to date." |
---|
37 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.