diff options
author | Renato Botelho <renato@netgate.com> | 2017-08-15 14:22:20 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-08-15 14:22:26 -0300 |
commit | 4e1a3d15ab7dae835aa3e8761c821745dc0ff627 (patch) | |
tree | d7dcbb9908344b7237cede2d5a88c3538de3d0c5 /src/etc | |
parent | 262f5ebe9856fb82ccfc981e10c827b9909299b9 (diff) | |
download | pfsense-4e1a3d15ab7dae835aa3e8761c821745dc0ff627.zip pfsense-4e1a3d15ab7dae835aa3e8761c821745dc0ff627.tar.gz |
Make sure pfSense-upgrade return code is obtained instead of tail's one
Diffstat (limited to 'src/etc')
-rwxr-xr-x | src/etc/rc.update_pkg_metadata | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/etc/rc.update_pkg_metadata b/src/etc/rc.update_pkg_metadata index 518b00e..f22c1af 100755 --- a/src/etc/rc.update_pkg_metadata +++ b/src/etc/rc.update_pkg_metadata @@ -32,8 +32,10 @@ tmp_version=$(mktemp -q /tmp/${product}_version.XXXXXXXX) \ sleep $sleep_time \ && /usr/local/sbin/${product}-upgrade -uf \ && ( \ - /usr/local/sbin/${product}-upgrade -Uc | tail -n 1 > $tmp_version \ + /usr/local/sbin/${product}-upgrade -Uc > ${tmp_version}.tmp \ ; rc=$? \ + ; tail -n 1 ${tmp_version}.tmp > $tmp_version \ + ; rm -f ${tmp_version}.tmp \ ; echo $rc > ${tmp_version}.rc \ ; test $rc -eq 2 && return 0 || return $rc \ ) \ |