bashrc/.bashrc.d/cn-fwupd.sh

21 lines
394 B
Bash
Raw Normal View History

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)
printf 'put %q firmware/update.puf' "$puf" | cnsftp $addr
cnssh $addr puf
;;
*)
echo "Error: Bad file type. Currently, only'.zip' and '.puf' file types are supported."
;;
esac
}