diff options
| author | David M. Syzdek <david@syzdek.net> | 2018-05-07 11:50:39 -0800 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2018-05-07 11:50:39 -0800 |
| commit | 41192052270091b58eab1e58a941cd483957855a (patch) | |
| tree | d7ddf41a9ed1188c463ffd8b348537a085e0e951 | |
| parent | cb5cbaf11cff6f7b31e1ea826c429de88eda1c23 (diff) | |
| download | iperd-41192052270091b58eab1e58a941cd483957855a.tar.gz iperd-41192052270091b58eab1e58a941cd483957855a.tar.bz2 iperd-41192052270091b58eab1e58a941cd483957855a.tar.xz iperd-41192052270091b58eab1e58a941cd483957855a.zip | |
Updating options to include ability to disable SSL checks
| -rw-r--r-- | src/scripts/configure.sh | 28 | ||||
| -rwxr-xr-x | src/scripts/download.sh | 14 | ||||
| -rwxr-xr-x | src/scripts/genfiles.sh | 1 | ||||
| -rw-r--r-- | src/scripts/iperd.profile | 2 |
4 files changed, 39 insertions, 6 deletions
diff --git a/src/scripts/configure.sh b/src/scripts/configure.sh index ef74822..3c3914c 100644 --- a/src/scripts/configure.sh +++ b/src/scripts/configure.sh | |||
| @@ -100,7 +100,7 @@ configure_disk() | |||
| 100 | # display main menu | 100 | # display main menu |
| 101 | exec 3>&1 | 101 | exec 3>&1 |
| 102 | RESULT="$(echo "" | xargs dialog \ | 102 | RESULT="$(echo "" | xargs dialog \ |
| 103 | --title " Disk Options " \ | 103 | --title " Miscellaneous Options " \ |
| 104 | --backtitle "IP Engineering Rescue Disk Setup" \ | 104 | --backtitle "IP Engineering Rescue Disk Setup" \ |
| 105 | --ok-label "Change" \ | 105 | --ok-label "Change" \ |
| 106 | --cancel-label "Back" \ | 106 | --cancel-label "Back" \ |
| @@ -109,6 +109,7 @@ configure_disk() | |||
| 109 | "usb" "USB partition type (${CONFIG_PART_TYPE})" \ | 109 | "usb" "USB partition type (${CONFIG_PART_TYPE})" \ |
| 110 | "size" "USB disk image size (${CONFIG_IMG_SIZE} MB)" \ | 110 | "size" "USB disk image size (${CONFIG_IMG_SIZE} MB)" \ |
| 111 | "iso" "ISO partition type (${CONFIG_ISO_TYPE})" \ | 111 | "iso" "ISO partition type (${CONFIG_ISO_TYPE})" \ |
| 112 | "tls" "TLS Certificate check (${CONFIG_TLS_CHECK})" \ | ||
| 112 | 2>&1 1>&3)" | 113 | 2>&1 1>&3)" |
| 113 | RC=$? | 114 | RC=$? |
| 114 | exec 3>&- | 115 | exec 3>&- |
| @@ -177,6 +178,21 @@ configure_disk() | |||
| 177 | RC=$? | 178 | RC=$? |
| 178 | exec 3>&- | 179 | exec 3>&- |
| 179 | CONFIG_ISO_TYPE="${RESULT}" | 180 | CONFIG_ISO_TYPE="${RESULT}" |
| 181 | elif test $RC -eq 0 && test "x${RESULT}" == "xtls";then | ||
| 182 | exec 3>&1 | ||
| 183 | RESULT="$(echo "" | xargs dialog \ | ||
| 184 | --title " TLS Certificate Checks " \ | ||
| 185 | --backtitle "IP Engineering Rescue Disk Setup" \ | ||
| 186 | --yesno "\nEnable TLS certificate checks when downloading files?" \ | ||
| 187 | 7 70 \ | ||
| 188 | 2>&1 1>&3)" | ||
| 189 | RC=$? | ||
| 190 | exec 3>&- | ||
| 191 | if test $RC -eq 0;then | ||
| 192 | CONFIG_TLS_CHECK=yes | ||
| 193 | else | ||
| 194 | CONFIG_TLS_CHECK=no | ||
| 195 | fi | ||
| 180 | fi | 196 | fi |
| 181 | done | 197 | done |
| 182 | } | 198 | } |
| @@ -270,7 +286,7 @@ configure_distros_image() | |||
| 270 | configure_save() | 286 | configure_save() |
| 271 | { | 287 | { |
| 272 | # save variables | 288 | # save variables |
| 273 | for STR in "CONFIG_PART_TYPE" "CONFIG_IMG_SIZE" "CONFIG_ISO_TYPE";do | 289 | for STR in "CONFIG_PART_TYPE" "CONFIG_IMG_SIZE" "CONFIG_ISO_TYPE" "CONFIG_TLS_CHECK";do |
| 274 | egrep "^${STR}=" "${CONFIG}.new" > /dev/null | 290 | egrep "^${STR}=" "${CONFIG}.new" > /dev/null |
| 275 | if test $? -ne 0;then | 291 | if test $? -ne 0;then |
| 276 | echo "${STR}=" >> "${CONFIG}.new" | 292 | echo "${STR}=" >> "${CONFIG}.new" |
| @@ -281,6 +297,7 @@ configure_save() | |||
| 281 | -e "s/^CONFIG_IMG_SIZE=.*$/CONFIG_IMG_SIZE=${CONFIG_IMG_SIZE}/g" \ | 297 | -e "s/^CONFIG_IMG_SIZE=.*$/CONFIG_IMG_SIZE=${CONFIG_IMG_SIZE}/g" \ |
| 282 | -e "s/^CONFIG_PART_TYPE=.*$/CONFIG_PART_TYPE=${CONFIG_PART_TYPE}/g" \ | 298 | -e "s/^CONFIG_PART_TYPE=.*$/CONFIG_PART_TYPE=${CONFIG_PART_TYPE}/g" \ |
| 283 | -e "s/^CONFIG_PART_SIZE=.*$/CONFIG_PART_SIZE=${CONFIG_PART_SIZE}/g" \ | 299 | -e "s/^CONFIG_PART_SIZE=.*$/CONFIG_PART_SIZE=${CONFIG_PART_SIZE}/g" \ |
| 300 | -e "s/^CONFIG_TLS_CHECK=.*$/CONFIG_TLS_CHECK=${CONFIG_TLS_CHECK}/g" \ | ||
| 284 | "${CONFIG}.new" \ | 301 | "${CONFIG}.new" \ |
| 285 | > "${CONFIG}.new.tmp" | 302 | > "${CONFIG}.new.tmp" |
| 286 | mv "${CONFIG}.new.tmp" "${CONFIG}.new" | 303 | mv "${CONFIG}.new.tmp" "${CONFIG}.new" |
| @@ -352,7 +369,7 @@ while test true;do | |||
| 352 | --cancel-label "Exit" \ | 369 | --cancel-label "Exit" \ |
| 353 | --menu "Select item to configure:" \ | 370 | --menu "Select item to configure:" \ |
| 354 | 20 70 13 \ | 371 | 20 70 13 \ |
| 355 | "disk" "Change disk image options" \ | 372 | "options" "Change miscellaneous options" \ |
| 356 | "images" "Select individual boot images" \ | 373 | "images" "Select individual boot images" \ |
| 357 | "all" "Select all available images" \ | 374 | "all" "Select all available images" \ |
| 358 | "defaults" "Load defaults" \ | 375 | "defaults" "Load defaults" \ |
| @@ -375,7 +392,7 @@ while test true;do | |||
| 375 | elif test $RC -eq 126;then # (save) | 392 | elif test $RC -eq 126;then # (save) |
| 376 | configure_save | 393 | configure_save |
| 377 | exit 0 | 394 | exit 0 |
| 378 | elif test $RC -eq 0 && test "x${RESULT}" == "xdisk";then | 395 | elif test $RC -eq 0 && test "x${RESULT}" == "xoptions";then |
| 379 | configure_disk | 396 | configure_disk |
| 380 | elif test $RC -eq 0 && test "x${RESULT}" == "ximages";then | 397 | elif test $RC -eq 0 && test "x${RESULT}" == "ximages";then |
| 381 | configure_distros | 398 | configure_distros |
| @@ -385,7 +402,8 @@ while test true;do | |||
| 385 | CONFIG_PART_TYPE="${DEFAULT_PART_TYPE}" | 402 | CONFIG_PART_TYPE="${DEFAULT_PART_TYPE}" |
| 386 | CONFIG_PART_SIZE="${DEFAULT_PART_SIZE}" | 403 | CONFIG_PART_SIZE="${DEFAULT_PART_SIZE}" |
| 387 | CONFIG_IMG_SIZE="${DEFAULT_IMG_SIZE}" | 404 | CONFIG_IMG_SIZE="${DEFAULT_IMG_SIZE}" |
| 388 | CONFIG_ISO_TYPE="${DEFAULT_ISO_SIZE}" | 405 | CONFIG_ISO_TYPE="${DEFAULT_ISO_TYPE}" |
| 406 | CONFIG_TLS_CHECK="${DEFAULT_TLS_CHECK}" | ||
| 389 | cat /dev/null > ${CONFIG}.new | 407 | cat /dev/null > ${CONFIG}.new |
| 390 | dialog \ | 408 | dialog \ |
| 391 | --backtitle "IP Engineering Rescue Disk Setup" \ | 409 | --backtitle "IP Engineering Rescue Disk Setup" \ |
diff --git a/src/scripts/download.sh b/src/scripts/download.sh index 2ed5d12..cf79b8c 100755 --- a/src/scripts/download.sh +++ b/src/scripts/download.sh | |||
| @@ -39,8 +39,15 @@ | |||
| 39 | # | | | 39 | # | | |
| 40 | # +-=-=-=-=-=-+ | 40 | # +-=-=-=-=-=-+ |
| 41 | 41 | ||
| 42 | # set program name for errors | 42 | # set PROG_NAME and load profile |
| 43 | PROG_NAME="$(basename "${0}")" | 43 | PROG_NAME="$(basename "${0}")" |
| 44 | IPERD_PROFILE="$(dirname "${0}")/iperd.profile" | ||
| 45 | if test ! -f "${IPERD_PROFILE}";then | ||
| 46 | echo "${PROG_NAME}: unable to find iperd.profile" 1>&2; | ||
| 47 | exit 1; | ||
| 48 | fi | ||
| 49 | . "${IPERD_PROFILE}" | ||
| 50 | |||
| 44 | 51 | ||
| 45 | # set logging function | 52 | # set logging function |
| 46 | LOGGER="/usr/bin/sed -e s/^/${PROGRAM_NAME}:/g" | 53 | LOGGER="/usr/bin/sed -e s/^/${PROGRAM_NAME}:/g" |
| @@ -145,6 +152,7 @@ unset HASH_FILE | |||
| 145 | unset HASH_DATA | 152 | unset HASH_DATA |
| 146 | unset KEEPTEMPFILE | 153 | unset KEEPTEMPFILE |
| 147 | unset EXTRACT_MKTEMP | 154 | unset EXTRACT_MKTEMP |
| 155 | unset WGET_FLAGS | ||
| 148 | 156 | ||
| 149 | 157 | ||
| 150 | # parse CLI arguments | 158 | # parse CLI arguments |
| @@ -183,6 +191,9 @@ fi | |||
| 183 | 191 | ||
| 184 | 192 | ||
| 185 | # adjust options | 193 | # adjust options |
| 194 | if test "x${CONFIG_TLS_CHECK}" == "xno";then | ||
| 195 | WGET_FLAGS="${WGET_FLAGS} --no-check-certificate"; | ||
| 196 | fi | ||
| 186 | if test -z "${TMPFILE}";then | 197 | if test -z "${TMPFILE}";then |
| 187 | TMPFILE="${FILE}.tmp" | 198 | TMPFILE="${FILE}.tmp" |
| 188 | fi | 199 | fi |
| @@ -240,6 +251,7 @@ trap cleanup SIGHUP SIGINT SIGTERM EXIT | |||
| 240 | if test ! -f "${TMPFILE}" && test ! -f "${FILE}";then | 251 | if test ! -f "${TMPFILE}" && test ! -f "${FILE}";then |
| 241 | mkdir -p "$(dirname "${TMPFILE}")" || exit 1; | 252 | mkdir -p "$(dirname "${TMPFILE}")" || exit 1; |
| 242 | wget \ | 253 | wget \ |
| 254 | ${WGET_FLAGS} \ | ||
| 243 | -q \ | 255 | -q \ |
| 244 | -O "${TMPFILE}.new" \ | 256 | -O "${TMPFILE}.new" \ |
| 245 | "${URL}" \ | 257 | "${URL}" \ |
diff --git a/src/scripts/genfiles.sh b/src/scripts/genfiles.sh index c257c34..ed3b68a 100755 --- a/src/scripts/genfiles.sh +++ b/src/scripts/genfiles.sh | |||
| @@ -95,6 +95,7 @@ generate_makefile_config() | |||
| 95 | echo "DISKSIZE ?= ${CONFIG_IMG_SIZE}" | 95 | echo "DISKSIZE ?= ${CONFIG_IMG_SIZE}" |
| 96 | echo "DISKTYPE ?= ${CONFIG_PART_TYPE}" | 96 | echo "DISKTYPE ?= ${CONFIG_PART_TYPE}" |
| 97 | echo "PARTSIZE ?= ${CONFIG_PART_SIZE}" | 97 | echo "PARTSIZE ?= ${CONFIG_PART_SIZE}" |
| 98 | echo "TLSCHECK ?= ${CONFIG_TLS_CHECK}" | ||
| 98 | 99 | ||
| 99 | # define standard dependencies | 100 | # define standard dependencies |
| 100 | STD_DEP_FILES="src/scripts/genfiles.sh" | 101 | STD_DEP_FILES="src/scripts/genfiles.sh" |
diff --git a/src/scripts/iperd.profile b/src/scripts/iperd.profile index 97f8b1f..862b77d 100644 --- a/src/scripts/iperd.profile +++ b/src/scripts/iperd.profile | |||
| @@ -52,10 +52,12 @@ DEFAULT_PART_TYPE="hybrid" | |||
| 52 | DEFAULT_PART_SIZE="0" | 52 | DEFAULT_PART_SIZE="0" |
| 53 | DEFAULT_IMG_SIZE="1900" | 53 | DEFAULT_IMG_SIZE="1900" |
| 54 | DEFAULT_ISO_TYPE="bios" | 54 | DEFAULT_ISO_TYPE="bios" |
| 55 | DEFAULT_TLS_CHECK="yes" | ||
| 55 | CONFIG_PART_TYPE="${CONFIG_PART_TYPE:-${DEFAULT_PART_TYPE}}" | 56 | CONFIG_PART_TYPE="${CONFIG_PART_TYPE:-${DEFAULT_PART_TYPE}}" |
| 56 | CONFIG_PART_SIZE="${CONFIG_PART_SIZE:-${DEFAULT_PART_SIZE}}" | 57 | CONFIG_PART_SIZE="${CONFIG_PART_SIZE:-${DEFAULT_PART_SIZE}}" |
| 57 | CONFIG_IMG_SIZE="${CONFIG_IMG_SIZE:-${DEFAULT_IMG_SIZE}}" | 58 | CONFIG_IMG_SIZE="${CONFIG_IMG_SIZE:-${DEFAULT_IMG_SIZE}}" |
| 58 | CONFIG_ISO_TYPE="${CONFIG_ISO_TYPE:-${DEFAULT_ISO_TYPE}}" | 59 | CONFIG_ISO_TYPE="${CONFIG_ISO_TYPE:-${DEFAULT_ISO_TYPE}}" |
| 60 | CONFIG_TLS_CHECK="${CONFIG_TLS_CHECK:-${DEFAULT_TLS_CHECK}}" | ||
| 59 | 61 | ||
| 60 | 62 | ||
| 61 | # set exit codes to trigger specific xargs exit codes | 63 | # set exit codes to trigger specific xargs exit codes |
