forked from mirrors/openup
Finalize auto-update.
Bump version.
This commit is contained in:
parent
66c83d3b34
commit
0b64f2e86f
1 changed files with 10 additions and 10 deletions
20
openup
20
openup
|
|
@ -53,7 +53,7 @@ if [ "${REL_INT}" -lt "${OPENUP_MINREL}" ]; then
|
|||
error "XXX release ${REL[0]} is a no-no (non-fatal)"
|
||||
fi
|
||||
|
||||
OPENUP_VERSION=1
|
||||
OPENUP_VERSION=2
|
||||
OPENUP_MINREL=53
|
||||
MEESA=$(readlink -f $0)
|
||||
TMPDIR="${TMPDIR:=/tmp}"
|
||||
|
|
@ -82,7 +82,7 @@ get_cert() {
|
|||
split -p '^-----BEGIN CERTIFICATE-----$' /etc/ssl/pkgca.pem ${TMPSPLITCERT}
|
||||
|
||||
for i in ${TMPSPLITCERT}* ; do
|
||||
openssl x509 -noout -in $i -fingerprint 2>/dev/null |
|
||||
openssl x509 -noout -in $i -fingerprint 2>/dev/null | \
|
||||
grep -q "${PKG_CERT_FPRINT}" && return
|
||||
done
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ update_self() {
|
|||
_CMD="ftp -Vo ${TMPUPD} ${OPENUP_URL}"
|
||||
print2 "${_CMD}"
|
||||
if [ -z "${DRYRUN}" ]; then
|
||||
eval ${_CMD} # non-fatal
|
||||
eval ${_CMD} || exit 1
|
||||
fi
|
||||
|
||||
_N=$(grep -Eo '^OPENUP_VERSION=.*' ${TMPUPD} | awk -F '=' '{ print $2 }')
|
||||
|
|
@ -117,13 +117,13 @@ update_self() {
|
|||
print3 "Updating openup(8) from version ${OPENUP_VERSION} to version ${_N}"
|
||||
_CMD="cat ${TMPUPD} >${MEESA}"
|
||||
print2 "${_CMD}"
|
||||
eval ${_CMD} # non-fatal
|
||||
if [ $? -eq 0 ]; then
|
||||
# XXX
|
||||
echo "successfully updated openup(8) to version ${_N}, restarting myself"
|
||||
${MEESA} -U $@
|
||||
exit $?
|
||||
fi
|
||||
eval ${_CMD} || exit 1
|
||||
rtn=$?
|
||||
print3 "openup(8) updated to version ${_N}, restarting"
|
||||
_CMD="${MEESA} -U $@"
|
||||
print2 "${_CMD}"
|
||||
eval ${_CMD}
|
||||
exit $rtn
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue