diff options
author | Renato Botelho <renato@netgate.com> | 2017-08-10 16:55:27 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-08-10 17:26:30 -0300 |
commit | ca77322046df2206512a4095b5e07003972a900d (patch) | |
tree | 787178480e83db7dcf5ee3f12e60494e3f80e263 /src/etc | |
parent | c47f209bfc4815e2056fa679f5083297cf292b82 (diff) | |
download | pfsense-ca77322046df2206512a4095b5e07003972a900d.zip pfsense-ca77322046df2206512a4095b5e07003972a900d.tar.gz |
Save pkg update return code
Diffstat (limited to 'src/etc')
-rwxr-xr-x | src/etc/rc.update_pkg_metadata | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/etc/rc.update_pkg_metadata b/src/etc/rc.update_pkg_metadata index 8c4e019..a0fcd48 100755 --- a/src/etc/rc.update_pkg_metadata +++ b/src/etc/rc.update_pkg_metadata @@ -32,11 +32,15 @@ tmp_version=$(mktemp -q /tmp/${product}_version.XXXXXXXX) \ sleep $sleep_time \ && /usr/local/sbin/${product}-upgrade -uf \ && ( \ - /usr/local/sbin/${product}-upgrade -Uc >> $tmp_version \ - ; test $? -eq 2 && return 0 \ + /usr/local/sbin/${product}-upgrade -Uc > $tmp_version \ + ; rc=$? \ + ; echo $rc > ${tmp_version}.rc \ + ; test $rc -eq 2 && return 0 || return $rc \ ) \ - && mv $tmp_version /var/run/${product}_version \ - || rm -f $tmp_version + && ( \ + mv $tmp_version /var/run/${product}_version \ + && mv ${tmp_version}.rc /var/run/${product}_version.rc \ + ) || rm -f $tmp_version ${tmp_version}.rc ) >/dev/null 2>&1 & exit 0 |