#! /bin/bash firmup_check() { local config=$1 local ma_version=`cat /etc/version` local VERSION="None" local URL="" . $config echo "MA version(current): \"$ma_version\"" echo "Version in config: \"$VERSION\"" if [ "$ma_version" != "$VERSION" ]; then echo "version unmatched, need to update firmware, firmware URL is \"$URL\"" # wget $URL -O /tmp/firmware.img # (download firmware) # firmup /tmp/firmware.img # (update firmware) else echo "version matched, not need to firm-update." fi } echo reconfig script invoked at `date`: $0 $* # $1 is module-id case "$1" in "0" ) firmup_check $4 ;; esac