File: update.sh

package info (click to toggle)
courier 0.47-4sarge5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 32,680 kB
  • ctags: 12,265
  • sloc: ansic: 164,045; cpp: 23,863; sh: 19,569; perl: 7,225; makefile: 4,192; yacc: 316; sed: 16
file content (23 lines) | stat: -rw-r--r-- 290 bytes parent folder | download | duplicates (25)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

filename="$1"
url="$2"

tmpfilename="$filename.tmp"

echo wget $url
wget -O - $url >$tmpfilename
if test ! -s $tmpfilename
then
	rm -f $tmpfilename
	exit 1
fi

if test -f $filename
then
	if cmp -s $filename $tmpfilename
	then
		rm -f $tmpfilename
		exit 0
	fi
fi
mv $tmpfilename $filename