Devin Teske
9a46c67aed
There's an API function for catching errors and displaying them or
...
logging them to debug output
2016-12-13 02:40:54 +00:00
Devin Teske
7e1166de96
There's an API function for displaying pauses
2016-12-13 02:30:24 +00:00
Devin Teske
d79a135578
There's an API function for displaying yes/no dialogs
2016-12-13 02:29:20 +00:00
Devin Teske
1d92999c48
There's an API function for displaying errors
2016-12-13 02:27:38 +00:00
Devin Teske
35af83c188
Comment
2016-12-13 02:25:23 +00:00
Devin Teske
b45548a80e
Whitespace alignment
2016-12-13 02:23:48 +00:00
Devin Teske
d5fddc4dcb
Relying on dialog auto-sizing (width/height/rows = 0) is a mistake
...
Use the provided API for calculating the appropriate size of menus
2016-12-13 02:22:21 +00:00
Devin Teske
7599c85424
Remove unnecessary quotes
2016-12-13 02:16:00 +00:00
Devin Teske
1095816ec3
Add missing quotes
2016-12-13 02:15:36 +00:00
Devin Teske
01a2404c35
In awk, if you're going to append a newline to your printf
...
AND you're going to print only the argument, just use print
2016-12-13 02:14:40 +00:00
Devin Teske
dba958af5d
This statement has too many backslashes
2016-12-13 02:13:20 +00:00
Devin Teske
be34885e2a
Neither printf (and as is commonly known) nor print need parens in awk
2016-12-13 02:12:00 +00:00
Devin Teske
5943bcd19f
Whitespace and alignment
2016-12-13 02:11:09 +00:00
Devin Teske
191441eed8
You don't need parentheses for awk's printf
2016-12-13 02:07:12 +00:00
Devin Teske
0724c87c95
Continued resolution of conveluted statement
...
We shouldn't be coding things like "x || (x && x) || x || x || x ..."
2016-12-13 02:04:50 +00:00
Devin Teske
32c34b0361
These two error messages have always been backwards since inception
2016-12-13 02:02:14 +00:00
Devin Teske
7f513d3675
Why use $? when you can use the command itself
2016-12-13 01:59:35 +00:00
Devin Teske
6b77f63e5d
If the first ping succeeded, why on Earth should we ping it again?
2016-12-13 01:56:28 +00:00
Devin Teske
a1a6fec1c7
Start deconstructing a conveluted hunk of code
2016-12-13 01:54:44 +00:00
Devin Teske
19cae84e23
Remove completely unnecesary parentheses
2016-12-13 01:52:10 +00:00
Devin Teske
751993945a
Why repeat yourself when you can send stderr to the same place as stdout?
2016-12-13 01:50:22 +00:00
Devin Teske
66ef7d9455
Properly quote variable
2016-12-13 01:44:18 +00:00
Devin Teske
a51195769a
Use more generic f_yesno() from provided API
2016-12-13 01:42:13 +00:00
Devin Teske
f52733d46e
The output of dialog needs to be sanitized
...
for portability/compatibility requirements
2016-12-13 01:41:06 +00:00
Devin Teske
f20b7768fc
Whitespace alignment
2016-12-13 01:39:09 +00:00
Devin Teske
d401d36c04
Sort the domains
2016-12-13 01:36:46 +00:00
Devin Teske
95ee591e83
The --no-items and --stdout options are non-standard and should be avoided
...
From the dialog(1) manual:
using [--stdout] in portable scripts is not recommended
2016-12-13 01:35:26 +00:00
Devin Teske
6e038cc2eb
More efficiently make use of the exit status
2016-12-13 00:27:56 +00:00
Devin Teske
1c61211223
Stop repeating strings (centralize prompt string)
...
NB: Changes to strings now only affect a single line
2016-12-13 00:22:01 +00:00
Devin Teske
e2577019ed
Add missing backslash (no real effect; it's pedantic and correct for
...
the interpolation level)
2016-12-13 00:18:51 +00:00
Devin Teske
e7f2eb12c2
Use the oft-neglected awk syntax "startcondition, stopcondition { ... }" to
...
process the range of country labels which appear as columnar list from the
"ifconfig DEV list countries" command. Not only improving maintainability,
but also properly encapsulating arguments in single-quotes instead of
trying to escape whitespace. It is also completely unnecessary to collapse
newlines into whitespace (shell will do this for you automatically upon
expansion of the contents where necessary).
NB: This also changes the sorting algorithm to sort on the country code,
not the country name. The type-ahead feature of dialog is destroyed if the
tags are not sorted properly.
2016-12-13 00:02:59 +00:00
Devin Teske
49748e0a6d
Quote WLAN_IFACE (pedantic)
2016-12-12 22:57:07 +00:00
Devin Teske
6c26775c2f
In awk, casting a variable as a boolean condition is the same as testing if
...
the length of the variable contents is greater than zero
This allows us to also move the secondary condition into the action clause
2016-12-12 21:29:48 +00:00
Devin Teske
275c0c0741
Remove an unnecessary call to f_dialog_title_restore()
2016-12-12 21:27:29 +00:00
Devin Teske
1045858386
Whitespace
2016-12-12 21:26:36 +00:00
Devin Teske
d124dfc410
Utilize provided i18n strings
2016-12-12 21:23:47 +00:00
Devin Teske
877ea04721
Remove incomplete and unnecessary creation of fd3
...
The provided API already provides a passthru descriptor and even
gives you a varaible for referring to it.
2016-12-12 21:20:56 +00:00
Devin Teske
8bcf564644
Remove unnecessary semi-colons
2016-12-12 21:18:24 +00:00
Devin Teske
0b8f01fe99
Use awk the following (more succinct) awk syntax:
...
condition1 { action1 }
condition2 { action2 }
instead of the following syntax:
{
if (condition1) { action1 }
else if (condition2) { action2 }
}
2016-12-12 21:16:37 +00:00
Devin Teske
d9f83eb9f4
1 is the default descriptor for redirects without an fd prefix
2016-12-12 21:11:55 +00:00
Devin Teske
bef42d18c5
Fix invalid parameter expansion (change $@ to "$@")
...
Without quotes, $@ loses its special meanining (see below)
% sh -c 'echo $@' /bin/sh " 1 " " 2 "
1 2
% sh -c 'echo "$@"' /bin/sh " 1 " " 2 "
1 2
The quotes are required to get ARGV to be unperterped
2016-12-12 21:04:11 +00:00
Devin Teske
35c8d5eb1b
Allow the script path to contain whitespace and special characters
2016-12-12 21:01:20 +00:00
Devin Teske
58ce2edc98
Use provided API to centralize dialog title strings
2016-12-12 21:00:09 +00:00
Devin Teske
7797a5973f
Reorder dialog parameters based on commonality for readability
2016-12-12 20:54:20 +00:00
Devin Teske
6ea6e3fa7d
Fix incorrect use of provided API
...
The result of which was incorrectly sized menu dialogs
2016-12-12 20:49:49 +00:00
Devin Teske
ea2e60b01c
Use provided API (change "dialog" to "$DIALOG")
2016-12-12 20:43:09 +00:00
Devin Teske
2abc4c242e
Whitespace (dialog options separated to minimize diffs)
2016-12-12 20:41:27 +00:00
Devin Teske
b5938e7da3
Consolidate redirects into here documents, with proper code indentation
2016-12-12 19:46:49 +00:00
Devin Teske
15fadc4858
Remove an unnecessary "return $?" at end of function
2016-12-12 19:26:55 +00:00
Devin Teske
7bcf4508be
Use ternary operator
2016-12-12 19:24:32 +00:00