diff options
author | Bill Marquette <billm@pfsense.org> | 2005-04-10 20:44:50 +0000 |
---|---|---|
committer | Bill Marquette <billm@pfsense.org> | 2005-04-10 20:44:50 +0000 |
commit | cf4cdbf0ef02a02fd5d9b7e8577c73da867fdef5 (patch) | |
tree | 514be0c32e48b45eeb56a20bcb8c164ea9f6c8a8 /etc | |
parent | ea041900c7c14ed679e31cc96c90114347051949 (diff) | |
download | pfsense-cf4cdbf0ef02a02fd5d9b7e8577c73da867fdef5.zip pfsense-cf4cdbf0ef02a02fd5d9b7e8577c73da867fdef5.tar.gz |
A little cleanup of the new firmware upgrade code
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.firmware | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware index 3b5a196..31f50c1 100755 --- a/etc/rc.firmware +++ b/etc/rc.firmware @@ -110,24 +110,21 @@ binary_update() { cd /tmp/patched for i in `tar tzf $TGZ | egrep -v "(^\./\.*/$|^\./$|.md5)"`; do ( - bspatch /$i /tmp/$i /tmp/patched/$i; - echo Working on $i; - tar xvzf $TGZ $i; - tar xvzf $TGZ.old_file_md5 $i.old_file_md5; - tar xvzf $TGZ.new_patch_md5 $i.new_patch_md5; - tar xvzf $TGZ.new_file_md5 $i.new_file_md5; - OLD_FILE_MD5=`cat /tmp/$i.old_file_md5`; - NEW_PATCH_MD5=`cat /tmp/$i.new_patch_md5`; - NEW_FILE_MD5=`cat /tmp/$i.new_file_md5`; - PATCHED_MD5=`md5 /tmp/patched/$i | cut -d" " -f4`; + /usr/local/bin/bspatch /${i} /tmp/${i} /tmp/patched/${i}; + echo "Working on ${i}"; + /usr/bin/tar xvzf ${TGZ} ${i}*; + OLD_FILE_MD5=`cat /tmp/${i}.old_file_md5`; + NEW_PATCH_MD5=`cat /tmp/${i}.new_patch_md5`; + NEW_FILE_MD5=`cat /tmp/${i}.new_file_md5`; + PATCHED_MD5=`/sbin/md5 -q /tmp/patched/${i}`; if [ "$PATCHED_MD5" = "$NEW_FILE_MD5" ]; then - mv /tmp/patched/$i /$i; + /bin/mv /tmp/patched/${i} /${i}; else - echo $i file does not match intended final md5.; - echo $i file does not match intended final md5. >> /tmp/errors; + echo "${i} file does not match intended final md5."; + echo "${i} file does not match intended final md5." >> /tmp/errors; fi - rm /tmp/patched/$i.*; - rm /tmp/patched/$i + /bin/rm /tmp/patched/${i}.*; + /bin/rm /tmp/patched/${i} ); done } |