summaryrefslogtreecommitdiffstats
path: root/etc/rc.firmware
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-04-10 20:44:50 +0000
committerBill Marquette <billm@pfsense.org>2005-04-10 20:44:50 +0000
commitcf4cdbf0ef02a02fd5d9b7e8577c73da867fdef5 (patch)
tree514be0c32e48b45eeb56a20bcb8c164ea9f6c8a8 /etc/rc.firmware
parentea041900c7c14ed679e31cc96c90114347051949 (diff)
downloadpfsense-cf4cdbf0ef02a02fd5d9b7e8577c73da867fdef5.zip
pfsense-cf4cdbf0ef02a02fd5d9b7e8577c73da867fdef5.tar.gz
A little cleanup of the new firmware upgrade code
Diffstat (limited to 'etc/rc.firmware')
-rwxr-xr-xetc/rc.firmware27
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
}
OpenPOWER on IntegriCloud