diff options
author | Renato Botelho <renato@netgate.com> | 2015-09-03 08:11:13 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-09-03 08:11:13 -0300 |
commit | f238a83f3f559d31c56caafec3923d2f722ec307 (patch) | |
tree | 561c1ee8cd8255a1b1a3dc00f0cd11f92c68dea3 | |
parent | ab54d7171f5d469ddbaea5211d0d5693f1c96984 (diff) | |
download | pfsense-f238a83f3f559d31c56caafec3923d2f722ec307.zip pfsense-f238a83f3f559d31c56caafec3923d2f722ec307.tar.gz |
Simplify check for mandatory variables
-rwxr-xr-x | build.sh | 26 |
1 files changed, 7 insertions, 19 deletions
@@ -288,25 +288,13 @@ if [ "${BUILDACTION}" != "images" ]; then fi if [ -n "${SNAPSHOTS}" -a -z "${DO_NOT_UPLOAD}" ]; then - if [ -z "${RSYNCIP}" ]; then - echo ">>> ERROR: RSYNCIP is not defined" - exit 1 - fi - - if [ -z "${RSYNCUSER}" ]; then - echo ">>> ERROR: RSYNCUSER is not defined" - exit 1 - fi - - if [ -z "${RSYNCPATH}" ]; then - echo ">>> ERROR: RSYNCPATH is not defined" - exit 1 - fi - - if [ -z "${RSYNCLOGS}" ]; then - echo ">>> ERROR: RSYNCLOGS is not defined" - exit 1 - fi + for _var in RSYNCIP RSYNCUSER RSYNCPATH RSYNCLOGS; do + eval "_value=\${$_var}" + if [ -z "${_value}" ]; then + echo ">>> ERROR: ${_var} is not defined" + exit 1 + fi + done fi if [ $# -gt 1 ]; then |