2019-12-11 17:46:30 +00:00
|
|
|
cn-fwupd() {
|
|
|
|
local addr="$1"
|
|
|
|
local puf="$2"
|
|
|
|
local ext="${puf##*.}"
|
|
|
|
|
|
|
|
case $ext in
|
|
|
|
|
|
|
|
zip)
|
|
|
|
printf 'put %q firmware/update.zip' "$puf" | cnsftp $addr
|
|
|
|
cnssh $addr pushupdate FULL
|
|
|
|
;;
|
|
|
|
puf)
|
2021-05-06 22:42:26 +00:00
|
|
|
printf 'put %q firmware/' "$puf" | cnsftp $addr
|
2019-12-11 17:46:30 +00:00
|
|
|
cnssh $addr puf
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Error: Bad file type. Currently, only'.zip' and '.puf' file types are supported."
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|