Index: tools/pkgr_an_d_get.sh ================================================================== --- tools/pkgr_an_d_get.sh +++ tools/pkgr_an_d_get.sh @@ -4,14 +4,12 @@ echo "The program 'tclsh' is apparently not installed." echo "Please use 'apt-get install tcl8.6' (Linux)." exit 1 fi -echo "exit [catch {package require tls}]" | tclsh - -if [ $? -ne 0 ]; then - echo the "The 'tls' package for Tcl is not installed." +if ! echo "exit [catch {package require tls}]" | tclsh; then + echo "The 'tls' package for Tcl is not installed." echo "Please use 'apt-get install tcl-tls' (Linux)." exit 1 fi if [ ! -x "$(command -v wget)" ] && [ ! -x "$(command -v curl)" ]; then @@ -59,23 +57,25 @@ PKGR_GET_OK=0 if [ -x "$(command -v wget)" ]; then for wgetArg in "" "--no-check-certificate" do - wget -4 $wgetArg "--output-document=${PKGR_TMP_FILE}" "${PKGR_CLIENT_URI}" - if [ $? -eq 0 ] && [ -f "${PKGR_TMP_FILE}" ]; then - PKGR_GET_OK=1 - break + if wget -4 $wgetArg "--output-document=${PKGR_TMP_FILE}" "${PKGR_CLIENT_URI}"; then + if [ -f "${PKGR_TMP_FILE}" ]; then + PKGR_GET_OK=1 + break + fi fi done else for curlArg in "" "--insecure" do - curl -4 $curlArg --location "${PKGR_CLIENT_URI}" > "${PKGR_TMP_FILE}" - if [ $? -eq 0 ] && [ -f "${PKGR_TMP_FILE}" ]; then - PKGR_GET_OK=1 - break + if curl -4 $curlArg --location "${PKGR_CLIENT_URI}" > "${PKGR_TMP_FILE}"; then + if [ -f "${PKGR_TMP_FILE}" ]; then + PKGR_GET_OK=1 + break + fi fi done fi if [ $PKGR_GET_OK -eq 0 ] || [ ! -f "${PKGR_TMP_FILE}" ]; then Index: tools/pkgr_an_d_install.sh ================================================================== --- tools/pkgr_an_d_install.sh +++ tools/pkgr_an_d_install.sh @@ -4,14 +4,12 @@ echo "The program 'tclsh' is apparently not installed." echo "Please use 'apt-get install tcl8.6' (Linux)." exit 1 fi -echo "exit [catch {package require tls}]" | tclsh - -if [ $? -ne 0 ]; then - echo the "The 'tls' package for Tcl is not installed." +if ! echo "exit [catch {package require tls}]" | tclsh; then + echo "The 'tls' package for Tcl is not installed." echo "Please use 'apt-get install tcl-tls' (Linux)." exit 1 fi if [ ! -x "$(command -v wget)" ] && [ ! -x "$(command -v curl)" ]; then @@ -92,23 +90,25 @@ PKGR_GET_OK=0 if [ -x "$(command -v wget)" ]; then for wgetArg in "" "--no-check-certificate" do - wget -4 $wgetArg "--output-document=${PKGR_TMP_FILE}" "${PKGR_CLIENT_URI}" - if [ $? -eq 0 ] && [ -f "${PKGR_TMP_FILE}" ]; then - PKGR_GET_OK=1 - break + if wget -4 $wgetArg "--output-document=${PKGR_TMP_FILE}" "${PKGR_CLIENT_URI}"; then + if [ -f "${PKGR_TMP_FILE}" ]; then + PKGR_GET_OK=1 + break + fi fi done else for curlArg in "" "--insecure" do - curl -4 $curlArg --location "${PKGR_CLIENT_URI}" > "${PKGR_TMP_FILE}" - if [ $? -eq 0 ] && [ -f "${PKGR_TMP_FILE}" ]; then - PKGR_GET_OK=1 - break + if curl -4 $curlArg --location "${PKGR_CLIENT_URI}" > "${PKGR_TMP_FILE}"; then + if [ -f "${PKGR_TMP_FILE}" ]; then + PKGR_GET_OK=1 + break + fi fi done fi if [ $PKGR_GET_OK -eq 0 ] || [ ! -f "${PKGR_TMP_FILE}" ]; then