dualboot: update-firmware: new script option ('-s')
This option combined with '-a' ('--active') only prints the active block: a or b
The purpose an output to be consumed by other scripts or programs.
https://onedigi.atlassian.net/browse/DEL-8399
Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
This commit is contained in:
parent
556bda6d57
commit
1b17e8f657
|
|
@ -25,6 +25,7 @@ VERBOSE=""
|
||||||
PUBLIC_KEY="/etc/ssl/certs/key.pub"
|
PUBLIC_KEY="/etc/ssl/certs/key.pub"
|
||||||
ACTIVE_SYSTEM="$(fw_printenv -n active_system 2>/dev/null)"
|
ACTIVE_SYSTEM="$(fw_printenv -n active_system 2>/dev/null)"
|
||||||
SHOW_ACTIVE_SYSTEM=0
|
SHOW_ACTIVE_SYSTEM=0
|
||||||
|
SCRIPT_MODE=0
|
||||||
REBOOT=1
|
REBOOT=1
|
||||||
UPDATE_FILE=""
|
UPDATE_FILE=""
|
||||||
ALT_BOOT=""
|
ALT_BOOT=""
|
||||||
|
|
@ -48,7 +49,14 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
show_active_system() {
|
show_active_system() {
|
||||||
echo "Active system is $(echo ${ACTIVE_SYSTEM} | cut -d'_' -f2 | tr [:lower:] [:upper:])"
|
local act_sys="$(echo ${ACTIVE_SYSTEM} | cut -d'_' -f2)"
|
||||||
|
|
||||||
|
if [ ${SCRIPT_MODE} -eq 0 ]; then
|
||||||
|
act_sys="$(echo ${act_sys} | tr [:lower:] [:upper:])"
|
||||||
|
echo "Active system is ${act_sys}"
|
||||||
|
else
|
||||||
|
echo "${act_sys}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
reboot_system() {
|
reboot_system() {
|
||||||
|
|
@ -157,6 +165,8 @@ while :; do
|
||||||
;;
|
;;
|
||||||
--no-reboot) REBOOT=0
|
--no-reboot) REBOOT=0
|
||||||
;;
|
;;
|
||||||
|
-s) SCRIPT_MODE=1
|
||||||
|
;;
|
||||||
-v|--verbose) VERBOSE="-v"
|
-v|--verbose) VERBOSE="-v"
|
||||||
;;
|
;;
|
||||||
-h|--help) usage;exit
|
-h|--help) usage;exit
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue