1
0
Fork 0
forked from mirrors/openup

Clearer output.

This commit is contained in:
Antoine Jacoutot 2013-08-13 09:39:02 +02:00
commit 331b94ef66

26
openup
View file

@ -64,8 +64,8 @@ print3() {
echo "===> ${@}${DRYRUN}"
}
print2() {
echo "==> ${@}"
print_arrow() {
echo "-> ${@}"
}
get_cert() {
@ -81,14 +81,14 @@ get_cert() {
print3 "Downloading certificate"
_CMD="ftp -Vo ${TMPCERT} ${PKG_CERT_URL}"
print2 "${_CMD}"
print_arrow "${_CMD}"
if [ -z "${DRYRUN}" ]; then
eval ${_CMD} || exit 1
fi
print3 "Installing certificate"
_CMD="cat ${TMPCERT} >>/etc/ssl/pkgca.pem"
print2 "${_CMD}"
print_arrow "${_CMD}"
if [ -z "${DRYRUN}" ]; then
eval ${_CMD} || exit 1
fi
@ -97,9 +97,9 @@ get_cert() {
update_self() {
local _CMD _N
print3 "Checking for openup(8) update"
print3 "Checking for openup update"
_CMD="ftp -Vo ${TMPUPD} ${OPENUP_URL}"
print2 "${_CMD}"
print_arrow "${_CMD}"
if [ -z "${DRYRUN}" ]; then
eval ${_CMD} || exit 1
fi
@ -107,14 +107,14 @@ update_self() {
_N=$(grep -Eo '^OPENUP_VERSION=.*' ${TMPUPD} | awk -F '=' '{ print $2 }')
if [ -z "${DRYRUN}" -a -n "${_N}" ]; then
if [ "${OPENUP_VERSION}" -lt "${_N}" ]; then
print3 "Updating openup(8) from version ${OPENUP_VERSION} to version ${_N}"
print3 "Updating openup from version ${OPENUP_VERSION} to version ${_N}"
_CMD="cat ${TMPUPD} >${MEESA}"
print2 "${_CMD}"
print_arrow "${_CMD}"
eval ${_CMD} || exit 1
rtn=$?
print3 "openup(8) updated to version ${_N}, restarting"
print3 "openup updated to version ${_N}, restarting"
_CMD="${MEESA} -U $@"
print2 "${_CMD}"
print_arrow "${_CMD}"
eval ${_CMD}
exit $rtn
fi
@ -129,7 +129,7 @@ update_binpatches() {
if [ -n "$_BP" ]; then
print3 "Updating binpatch(es)"
_CMD="pkg_add ${pkg_opt} ${_BP}"
print2 "${_CMD}"
print_arrow "${_CMD}"
eval ${_CMD}
fi
}
@ -139,7 +139,7 @@ update_pkg() {
print3 "Updating package(s)"
_CMD="pkg_add -u ${pkg_opt}"
print2 "${_CMD}"
print_arrow "${_CMD}"
eval ${_CMD}
}
@ -148,7 +148,7 @@ update_fw() {
print3 "Updating firmware(s)"
_CMD="fw_update ${fw_opt}"
print2 "${_CMD}"
print_arrow "${_CMD}"
eval ${_CMD}
}