diff options
| author | David M. Syzdek <david@syzdek.net> | 2018-01-14 20:21:08 -0900 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2018-01-14 20:21:08 -0900 |
| commit | 6000affd0888fb83fb3ac17013ad8c4b1334be71 (patch) | |
| tree | e1d7561db9f977da1971055db4d29ac6fabbda2a | |
| parent | b101212b4b80c4ab94b630e407fedf0e9802489c (diff) | |
| download | iperd-6000affd0888fb83fb3ac17013ad8c4b1334be71.tar.gz iperd-6000affd0888fb83fb3ac17013ad8c4b1334be71.tar.bz2 iperd-6000affd0888fb83fb3ac17013ad8c4b1334be71.tar.xz iperd-6000affd0888fb83fb3ac17013ad8c4b1334be71.zip | |
Switch to 'while true' instead of 'while test -eq 0'
| -rw-r--r-- | src/scripts/configure.sh | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/src/scripts/configure.sh b/src/scripts/configure.sh index fff3d51..62d91ef 100644 --- a/src/scripts/configure.sh +++ b/src/scripts/configure.sh | |||
| @@ -71,8 +71,7 @@ cleanup() | |||
| 71 | configure() | 71 | configure() |
| 72 | { | 72 | { |
| 73 | # enter main loop | 73 | # enter main loop |
| 74 | CONTINUE=0 | 74 | while test true;do |
| 75 | while test ${CONTINUE} -eq 0;do | ||
| 76 | 75 | ||
| 77 | # display main menu | 76 | # display main menu |
| 78 | exec 3>&1 | 77 | exec 3>&1 |
| @@ -103,22 +102,17 @@ configure() | |||
| 103 | --yesno "Exit without saving?" \ | 102 | --yesno "Exit without saving?" \ |
| 104 | 6 30 | 103 | 6 30 |
| 105 | if test $? -eq 0;then | 104 | if test $? -eq 0;then |
| 106 | CONTINUE=1 | 105 | return 0 |
| 107 | else | ||
| 108 | CONTINUE=0 | ||
| 109 | fi | 106 | fi |
| 110 | elif test $RC -eq 126;then # (save) | 107 | elif test $RC -eq 126;then # (save) |
| 111 | deps | 108 | deps |
| 112 | CONTINUE=1 | 109 | return 0 |
| 113 | elif test $RC -eq 0 && test "x${RESULT}" == "xdisk";then | 110 | elif test $RC -eq 0 && test "x${RESULT}" == "xdisk";then |
| 114 | configure_disk | 111 | configure_disk |
| 115 | CONTINUE=0 | ||
| 116 | elif test $RC -eq 0 && test "x${RESULT}" == "ximages";then | 112 | elif test $RC -eq 0 && test "x${RESULT}" == "ximages";then |
| 117 | configure_distros | 113 | configure_distros |
| 118 | CONTINUE=0 | ||
| 119 | elif test $RC -eq 0 && test "x${RESULT}" == "xall";then | 114 | elif test $RC -eq 0 && test "x${RESULT}" == "xall";then |
| 120 | configure_all | 115 | configure_all |
| 121 | CONTINUE=0 | ||
| 122 | elif test $RC -eq 0 && test "x${RESULT}" == "xdefaults";then | 116 | elif test $RC -eq 0 && test "x${RESULT}" == "xdefaults";then |
| 123 | cat /dev/null > ${CONFIG}.new | 117 | cat /dev/null > ${CONFIG}.new |
| 124 | dialog \ | 118 | dialog \ |
| @@ -126,7 +120,6 @@ configure() | |||
| 126 | --no-tags \ | 120 | --no-tags \ |
| 127 | --msgbox "Defaults loaded." \ | 121 | --msgbox "Defaults loaded." \ |
| 128 | 6 30 | 122 | 6 30 |
| 129 | CONTINUE=0 | ||
| 130 | elif test $RC -eq 0 && test "x${RESULT}" == "xrevert";then | 123 | elif test $RC -eq 0 && test "x${RESULT}" == "xrevert";then |
| 131 | prereqs | 124 | prereqs |
| 132 | dialog \ | 125 | dialog \ |
| @@ -134,9 +127,6 @@ configure() | |||
| 134 | --no-tags \ | 127 | --no-tags \ |
| 135 | --msgbox "Changes reverted." \ | 128 | --msgbox "Changes reverted." \ |
| 136 | 6 30 | 129 | 6 30 |
| 137 | CONTINUE=0 | ||
| 138 | else | ||
| 139 | CONTINUE=0 | ||
| 140 | fi | 130 | fi |
| 141 | done | 131 | done |
| 142 | 132 | ||
| @@ -171,8 +161,7 @@ configure_all() | |||
| 171 | configure_disk() | 161 | configure_disk() |
| 172 | { | 162 | { |
| 173 | # enter main loop | 163 | # enter main loop |
| 174 | CONTINUE=0 | 164 | while test true;do |
| 175 | while test ${CONTINUE} -eq 0;do | ||
| 176 | 165 | ||
| 177 | # display main menu | 166 | # display main menu |
| 178 | exec 3>&1 | 167 | exec 3>&1 |
| @@ -192,7 +181,7 @@ configure_disk() | |||
| 192 | 181 | ||
| 193 | # inteprets selection | 182 | # inteprets selection |
| 194 | if test $RC -eq 124;then # (exit) | 183 | if test $RC -eq 124;then # (exit) |
| 195 | CONTINUE=1 | 184 | return 0; |
| 196 | elif test $RC -eq 0 && test "x${RESULT}" == "xusb";then | 185 | elif test $RC -eq 0 && test "x${RESULT}" == "xusb";then |
| 197 | exec 3>&1 | 186 | exec 3>&1 |
| 198 | RESULT="$(echo "" | xargs dialog \ | 187 | RESULT="$(echo "" | xargs dialog \ |
| @@ -206,7 +195,6 @@ configure_disk() | |||
| 206 | 2>&1 1>&3)" | 195 | 2>&1 1>&3)" |
| 207 | RC=$? | 196 | RC=$? |
| 208 | exec 3>&- | 197 | exec 3>&- |
| 209 | CONTINUE=0 | ||
| 210 | elif test $RC -eq 0 && test "x${RESULT}" == "xsize";then | 198 | elif test $RC -eq 0 && test "x${RESULT}" == "xsize";then |
| 211 | exec 3>&1 | 199 | exec 3>&1 |
| 212 | RESULT="$(echo "" | xargs dialog \ | 200 | RESULT="$(echo "" | xargs dialog \ |
| @@ -217,7 +205,6 @@ configure_disk() | |||
| 217 | 2>&1 1>&3)" | 205 | 2>&1 1>&3)" |
| 218 | RC=$? | 206 | RC=$? |
| 219 | exec 3>&- | 207 | exec 3>&- |
| 220 | CONTINUE=0 | ||
| 221 | elif test $RC -eq 0 && test "x${RESULT}" == "xiso";then | 208 | elif test $RC -eq 0 && test "x${RESULT}" == "xiso";then |
| 222 | exec 3>&1 | 209 | exec 3>&1 |
| 223 | RESULT="$(echo "" | xargs dialog \ | 210 | RESULT="$(echo "" | xargs dialog \ |
| @@ -231,9 +218,6 @@ configure_disk() | |||
| 231 | 2>&1 1>&3)" | 218 | 2>&1 1>&3)" |
| 232 | RC=$? | 219 | RC=$? |
| 233 | exec 3>&- | 220 | exec 3>&- |
| 234 | CONTINUE=0 | ||
| 235 | else | ||
| 236 | CONTINUE=0 | ||
| 237 | fi | 221 | fi |
| 238 | done | 222 | done |
| 239 | } | 223 | } |
| @@ -242,8 +226,7 @@ configure_disk() | |||
| 242 | configure_distros() | 226 | configure_distros() |
| 243 | { | 227 | { |
| 244 | # loop until exit | 228 | # loop until exit |
| 245 | CONTINUE=0 | 229 | while test true;do |
| 246 | while test $CONTINUE -eq 0;do | ||
| 247 | # prompt for OS distributions | 230 | # prompt for OS distributions |
| 248 | exec 3>&1 | 231 | exec 3>&1 |
| 249 | RESULT="$(list_distros \ | 232 | RESULT="$(list_distros \ |
| @@ -260,11 +243,10 @@ configure_distros() | |||
| 260 | exec 3>&- | 243 | exec 3>&- |
| 261 | 244 | ||
| 262 | # intepret the result | 245 | # intepret the result |
| 263 | if test $RC -eq 0;then | 246 | if test $RC -ne 0;then |
| 264 | configure_image "${RESULT}" | 247 | return 0; |
| 265 | CONTINUE=0 | ||
| 266 | else | 248 | else |
| 267 | CONTINUE=1 | 249 | configure_image "${RESULT}" |
| 268 | fi | 250 | fi |
| 269 | done | 251 | done |
| 270 | } | 252 | } |
