1
0
Fork 0
forked from mirrors/openup

Run $_CMD under eval, so that redirection is properly handled.

This commit is contained in:
Antoine Jacoutot 2013-08-09 09:31:58 +02:00
commit c02d1d5463

14
openup
View file

@ -78,14 +78,14 @@ get_cert() {
_CMD="ftp -Vo ${TMPCERT} ${PKG_CERT_URL}"
echo "==> ${_CMD}"
if [ -z "${DRYRUN}" ]; then
${_CMD} || exit 1
eval ${_CMD} || exit 1
fi
echo "===> Installing certificate"
_CMD="cat ${TMPCERT} >>/etc/ssl/pkgca.pem"
echo "==> ${_CMD}"
if [ -z "${DRYRUN}" ]; then
${_CMD} || exit 1
eval ${_CMD} || exit 1
fi
rm -f ${TMPCERT}
@ -98,7 +98,7 @@ update_self() {
_CMD="ftp -Vo ${TMPUPD} ${OPENUP_URL}"
echo "==> ${_CMD}"
if [ -z "${DRYRUN}" ]; then
${_CMD} # non-fatal
eval ${_CMD} # non-fatal
fi
_N=$(grep -Eo '^OPENUP_VERSION=.*' ${TMPUPD} | awk -F '=' '{ print $2 }')
@ -107,7 +107,7 @@ update_self() {
echo "===> Updating openup(8) from version ${OPENUP_VERSION} to version ${_N}"
_CMD="cat ${TMPUPD} >${MEESA}"
echo "==> ${_CMD}"
${_CMD} # non-fatal
eval ${_CMD} # non-fatal
if [ $? -eq 0 ]; then
# XXX
rm -f ${TMPUPD}
@ -129,7 +129,7 @@ update_binpatches() {
echo "===> Updating binpatch(es)"
_CMD="pkg_add ${pkg_opt} ${_BP}"
echo "==> ${_CMD}"
${_CMD}
eval ${_CMD}
fi
}
@ -139,7 +139,7 @@ update_pkg() {
echo "===> Updating package(s)"
_CMD="pkg_add -u ${pkg_opt}"
echo "==> ${_CMD}"
${_CMD}
eval ${_CMD}
}
update_fw() {
@ -148,7 +148,7 @@ update_fw() {
echo "===> Updating firmware(s)"
_CMD="fw_update ${fw_opt}"
echo "==> ${_CMD}"
${_CMD}
eval ${_CMD}
}
while getopts 'SUn' arg; do