From e6e417ab8e6271726b1a358be6316999d2e979e3 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 20 Aug 2005 21:44:07 +0000 Subject: New version Submitted-by: databeestje --- usr/local/sbin/update_file.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'usr/local') diff --git a/usr/local/sbin/update_file.sh b/usr/local/sbin/update_file.sh index a665f22..61753f0 100755 --- a/usr/local/sbin/update_file.sh +++ b/usr/local/sbin/update_file.sh @@ -6,16 +6,26 @@ if [ ! -x `which fetch` ];then fi baseurl='http://pfsense.com/cgi-bin/cvsweb.cgi/pfSense' -revision='?rev=1;content-type=text%2Fplain' +urlrev='?rev=' +urlcon=';content-type=text%2Fplain' +rev='1' if [ -z $1 ];then echo "No file to update given" + echo "Usage: $0 /path/to/file [revision]" exit 0 fi -if [ -f $1 ];then - #echo running `which fetch` -o "$1" "$baseurl$1$revision" - `which fetch` -o "$1" "$baseurl$1$revision" -else +if [ ! -f $1 ];then echo "File $1 doesn't exist" -fi \ No newline at end of file + exit 0 +fi + +if [ ! -z $2 ];then + rev=$2 + echo "trying to fetch $rev" +else + echo "trying to fetch latest" +fi + +`which fetch` -o "$1" "$baseurl$1$urlrev$rev$urlcon" \ No newline at end of file -- cgit v1.1