Make it so upgrade_system does not treat exit code 2 from fwupdmgr as an actual bad exit code
This commit is contained in:
parent
53d6febd20
commit
e784dc571b
1 changed files with 18 additions and 2 deletions
|
@ -42,8 +42,24 @@ upgrade_system() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v fwupdmgr &> /dev/null; then
|
if command -v fwupdmgr &> /dev/null; then
|
||||||
|
(
|
||||||
|
# 2 is a valid exit code for the fwupdmgr where
|
||||||
|
# the operation was successful but did not require
|
||||||
|
# action
|
||||||
|
set +e
|
||||||
|
|
||||||
fwupdmgr refresh
|
fwupdmgr refresh
|
||||||
|
STATUS=$?
|
||||||
|
if [ $STATUS -ne 0 ] && [ $STATUS -ne 2 ]; then
|
||||||
|
exit $STATUS
|
||||||
|
fi
|
||||||
|
|
||||||
fwupdmgr upgrade
|
fwupdmgr upgrade
|
||||||
|
STATUS=$?
|
||||||
|
if [ $STATUS -ne 0 ] && [ $STATUS -ne 2 ]; then
|
||||||
|
exit $STATUS
|
||||||
|
fi
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue