diff options
-rwxr-xr-x | tools/sfsnapshot | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/tools/sfsnapshot b/tools/sfsnapshot index efc5f01..3b71219 100755 --- a/tools/sfsnapshot +++ b/tools/sfsnapshot | |||
@@ -61,7 +61,7 @@ COMPILE_DIR=/tmp/tonvoon/tmp_snapshot | |||
61 | IN=${HOME}/tmp_snapshot | 61 | IN=${HOME}/tmp_snapshot |
62 | 62 | ||
63 | # Where to place the generated files | 63 | # Where to place the generated files |
64 | OUT_SERVER="tonvoon@shell.sf.net" | 64 | OUT_SERVER="tonvoon@web.sourceforge.net" |
65 | OUT="/home/groups/n/na/nagiosplug/htdocs/snapshot" | 65 | OUT="/home/groups/n/na/nagiosplug/htdocs/snapshot" |
66 | 66 | ||
67 | # Make sure prereqs are satisfied on server! | 67 | # Make sure prereqs are satisfied on server! |
@@ -77,20 +77,8 @@ for i in $* ; do | |||
77 | make_dist $i | 77 | make_dist $i |
78 | done | 78 | done |
79 | 79 | ||
80 | # Check for *.gz files locally (expect NFS between cf shell server and $CF) | ||
81 | set -x | ||
82 | files=$(ls $IN/*.gz 2>/dev/null) | ||
83 | [[ -z $files ]] && die "No files created" | ||
84 | head_file=$(cd $IN && ls *-trunk-*.gz 2>/dev/null) | ||
85 | ssh -2 $OUT_SERVER "rm -f $OUT/*.gz" | ||
86 | scp -2 $files $OUT_SERVER:$OUT | ||
87 | if [[ -n $head_file ]] ; then | ||
88 | ssh -2 $OUT_SERVER "cd $OUT && ln -s $head_file nagios-plugins-HEAD.tar.gz" | ||
89 | fi | ||
90 | |||
91 | # Create MD5 sum | 80 | # Create MD5 sum |
92 | ssh -2 $OUT_SERVER << EOF | 81 | cd $IN |
93 | cd $OUT | ||
94 | cat <<-END_README > README | 82 | cat <<-END_README > README |
95 | This is the daily SVN snapshot of nagiosplug, consisting of the SVN trunk | 83 | This is the daily SVN snapshot of nagiosplug, consisting of the SVN trunk |
96 | and any other branches. | 84 | and any other branches. |
@@ -101,9 +89,28 @@ The nagios-plugins-HEAD.tar.gz link will always go to the latest trunk snapshot | |||
101 | The MD5SUM is: | 89 | The MD5SUM is: |
102 | END_README | 90 | END_README |
103 | md5sum *.gz | tee -a README > MD5SUM | 91 | md5sum *.gz | tee -a README > MD5SUM |
92 | |||
93 | |||
94 | # Check for *.gz files locally (expect NFS between cf shell server and $CF) | ||
95 | set -x | ||
96 | cd $IN | ||
97 | files=$(ls *.gz 2>/dev/null) | ||
98 | [[ -z $files ]] && die "No files created" | ||
99 | head_file=$(cd $IN && ls -rt *-trunk-*.gz | head -1 2>/dev/null) | ||
100 | cat <<-EOF > /tmp/batchfile.$$ | ||
101 | cd $OUT | ||
102 | rm *.gz | ||
103 | put *.gz | ||
104 | ln $head_file nagios-plugins-HEAD.tar.gz | ||
105 | put MD5SUM | ||
106 | put README readme | ||
104 | EOF | 107 | EOF |
105 | 108 | ||
106 | rm -f $files | 109 | # Do the actual transfer |
110 | # Have to put README down as readme because SF's apache server appears to block README files | ||
111 | sftp -b /tmp/batchfile.$$ $OUT_SERVER | ||
112 | |||
113 | rm -f $files /tmp/batchfile.$$ | ||
107 | 114 | ||
108 | # Work out success or failure | 115 | # Work out success or failure |
109 | expected=$(($# + 1)) | 116 | expected=$(($# + 1)) |