diff options
-rwxr-xr-x | usr/local/sbin/update_file.sh | 22 |
1 files changed, 16 insertions, 6 deletions
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 |