mirror of
https://git.planet-casio.com/Lephenixnoir/fxsdk.git
synced 2025-04-16 07:56:57 +02:00
fxsdk: add file size sanity check before sending
This commit is contained in:
parent
181ed5cccd
commit
82c0e0ed67
1 changed files with 8 additions and 0 deletions
|
@ -311,6 +311,14 @@ fxsdk_send_cp() {
|
|||
return 1
|
||||
fi
|
||||
hh2_bin_files=$(find -maxdepth 1 -name '*-hh2.bin')
|
||||
|
||||
# Sanity check for file size
|
||||
size=$(du -bc ${hh2_bin_files} | tail -n 1 | cut -f1)
|
||||
if [[ $size -gt 2000000 ]]; then
|
||||
echo "$TAG WARNING: file (${hh2_bin_files}) is > 2 MB, is that a link bug?" >&2
|
||||
return
|
||||
fi
|
||||
|
||||
echo "$TAG Running: fxlink -sw ${hh2_bin_files}"
|
||||
fxlink -sw ${hh2_bin_files}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue