9
9
10
10
11
11
if test -n ${BASH_VERSION} && test " ${BASH_VERSINFO[0]} " -eq 3; then
12
- >&2 echo ' Your version of bash(1) is not supported by this script.' ;
13
- >&2 echo " You're probably running on MacOS . We recommend that you either" ;
14
- >&2 echo ' install a newer version of bash(1), or you run this script with' ;
15
- >&2 echo ' another shell, like for example zsh(1):' ;
12
+ >&2 echo ' Your version of bash(1) isn ' t supported by this script.' ;
13
+ >&2 echo "You' re probably running on macOS . We recommend that you either" ;
14
+ >&2 echo 'install a newer version of bash(1) or run this script with';
15
+ >&2 echo 'another shell, such as zsh(1):';
16
16
>&2 echo " $ zsh ${SUDO_USER: +sudo } $0 ..." ;
17
17
exit 1;
18
18
fi;
@@ -52,16 +52,16 @@ COMMANDS
52
52
for later installation.
53
53
54
54
welcome
55
- Creates an initial configuration to serve a welcome web page
56
- for NGINX Unit.
55
+ Create an initial configuration to serve a welcome web page
56
+ with NGINX Unit.
57
57
58
58
OPTIONS
59
59
-h, --help
60
60
Print this help.
61
61
62
62
--help-more
63
- Print help for more commands. They are experimental. This is
64
- not recommended unless you know what you're doing.
63
+ Print help for more commands. They are experimental. Using
64
+ these isn't recommended, unless you know what you're doing.
65
65
66
66
__EOF__
67
67
}
@@ -96,7 +96,7 @@ DESCRIPTION
96
96
COMMANDS
97
97
cmd Print the invocation line of unitd(8).
98
98
99
- ctl Control a running unitd(8) instance through its control socket.
99
+ ctl Control a running unitd(8) instance via its control API socket.
100
100
101
101
freeport
102
102
Print an available TCP port.
@@ -106,24 +106,23 @@ COMMANDS
106
106
array read from a file at a given INDEX.
107
107
108
108
os-probe
109
- This script probes the OS, and prints details about the
110
- version.
109
+ Probe the OS and print details about its version.
111
110
112
111
ps List unitd(8) processes.
113
112
114
113
repo-config
115
114
Configure your package manager with the NGINX Unit
116
- repository for later installation
115
+ repository for later installation.
117
116
118
- sock Print the address of the API control socket.
117
+ sock Print the control API socket address .
119
118
120
119
welcome
121
- Creates an initial configuration to serve a welcome web page
122
- for NGINX Unit.
120
+ Create an initial configuration to serve a welcome web page
121
+ with NGINX Unit.
123
122
124
123
OPTIONS
125
124
-h, --help
126
- Print the basic help (some commands are hidden).
125
+ Print basic help (some commands are hidden).
127
126
128
127
--help-more
129
128
Print the hidden help with more commands.
@@ -166,7 +165,7 @@ SYNOPSIS
166
165
$program_name cmd [-h]
167
166
168
167
DESCRIPTION
169
- Print the invocation line of running instances of unitd(8).
168
+ Print the invocation line of running unitd(8) instances .
170
169
171
170
OPTIONS
172
171
-h, --help
@@ -210,42 +209,40 @@ SYNOPSIS
210
209
+-- insert [-h] PATH INDEX
211
210
212
211
DESCRIPTION
213
- Control a running unitd(8) instance through its control socket.
212
+ Control a running unitd(8) instance through its control API socket.
214
213
215
214
Run '$program_name ctl SUBCOMMAND -h' for more information on a
216
215
subcommand.
217
216
218
217
SUBCOMMANDS
219
- http Send an HTTP request to the control socket.
218
+ http Send an HTTP request to the control API socket.
220
219
221
- insert Insert an element into a specified index in an array in the
220
+ insert Insert an element at the specified index into an array in the
222
221
JSON configuration.
223
222
224
223
OPTIONS
225
224
-h, --help
226
225
Print this help.
227
226
228
227
-s, --sock SOCK
229
- Use SOCK as the API control socket address. If not specified,
230
- the script will try to find it. This will be used by
231
- subcommands.
228
+ Use SOCK as the control API socket address. If not specified,
229
+ the script tries to find it. This value is used by subcommands.
232
230
233
- The socket can be a tcp(7) socket or a unix(7) socket, and in
234
- the case of a unix(7) socket, it can be local, or it can be in
231
+ The socket can be a tcp(7) socket or a unix(7) socket; in
232
+ the case of a unix(7) socket, it can exist locally or on
235
233
a remote machine, accessed through ssh(1). Accepted syntax
236
234
for SOCK:
237
235
238
236
unix:/path/to/control.sock
239
237
ssh://[user@]host[:port]/path/to/control.sock
240
238
[http[s]://]host[:port]
241
239
242
- The last form is less secure than the first two; you should
243
- have a look at:
240
+ The last form is less secure than the first two; have a look:
244
241
<https://unit.nginx.org/howto/security/#secure-socket-and-stat>
245
242
246
243
ENVIRONMENT
247
- Options take precedence over their equivalent environment variables,
248
- so if both are specified, the option will be used.
244
+ Options take precedence over their equivalent environment variables;
245
+ if both are specified, the command-line option is used.
249
246
250
247
UNIT_CTL_SOCK
251
248
Equivalent to the option -s (--sock).
@@ -324,9 +321,8 @@ OPTIONS
324
321
-c, --curl CURLOPT
325
322
Pass CURLOPT as an option to curl. This script is implemented
326
323
in terms of curl(1), so it's useful to be able to tweak its
327
- behavior. It can be used multiple times, which will be
328
- appended (and also appended to the contents of
329
- UNIT_CTL_HTTP_CURLOPTS).
324
+ behavior. The option can be cumulatively used multiple times
325
+ (the result is also appended to UNIT_CTL_HTTP_CURLOPTS).
330
326
331
327
-h, --help
332
328
Print this help.
@@ -425,8 +421,8 @@ SYNOPSIS
425
421
$program_name ctl [CTL-OPTS] insert [-h] PATH INDEX
426
422
427
423
DESCRIPTION
428
- Insert an element into a specified position (INDEX) in the JSON array
429
- in the unitd(8) configuration API at PATH .
424
+ Insert an element at the specified position (INDEX) into the JSON array
425
+ located at PATH in unitd(8) control API.
430
426
431
427
The new element is read from standard input.
432
428
@@ -518,7 +514,7 @@ SYNOPSIS
518
514
$program_name welcome [-hn]
519
515
520
516
DESCRIPTION
521
- This script tests an NGINX Unit instalation by creating an initial
517
+ This script tests an NGINX Unit installation by creating an initial
522
518
configuration and serving a welcome web page. Recommended for
523
519
first-time users.
524
520
@@ -527,7 +523,7 @@ OPTIONS
527
523
Print this help.
528
524
529
525
-n, --dry-run
530
- Dry run. Print the commands to be run instea of actually
526
+ Dry run. Print the commands to be run instead of actually
531
527
running them. Each command is preceded by a line explaining
532
528
what it does.
533
529
@@ -580,7 +576,7 @@ unit_ctl_welcome()
580
576
581
577
if test 0 -eq " $nprocs " ; then
582
578
warn " welcome: NGINX Unit isn' t running.";
583
- warn ' For help starting NGINX Unit, see:' ;
579
+ warn ' For help with starting NGINX Unit, see:' ;
584
580
err " <https://unit.nginx.org/installation/#startup-and-shutdown>";
585
581
elif test 1 -ne "$nprocs"; then
586
582
err ' welcome: Only one NGINX Unit instance should be running.' ;
@@ -590,7 +586,7 @@ unit_ctl_welcome()
590
586
local curl_opt="$(unit_sock_find | unit_sock_filter -c)";
591
587
592
588
curl $curl_opt/ >/dev/null 2>&1 \
593
- || err " welcome: Can't reach the control socket." ;
589
+ || err "welcome: Can' t reach the control API socket." ;
594
590
595
591
if ! test -v force; then
596
592
unit_cmd \
@@ -616,8 +612,8 @@ unit_ctl_welcome()
616
612
if test -e $conffile ; then
617
613
if ! unit_ctl_http ---s " $sock " 'GET' '/config' </dev/null 2>/dev/null | grep -q '^{}.\?$'; # The '.\?' is for the possible carriage return.
618
614
then
619
- warn ' welcome: NGINX Unit is already configured. If you are sure you want ' ;
620
- err ' to overwrite its current configuration, run again with --force.' ;
615
+ warn 'welcome: NGINX Unit is already configured. To overwrite ';
616
+ err 'its current configuration, run the script again with --force.';
621
617
fi;
622
618
fi;
623
619
fi;
@@ -835,7 +831,7 @@ SYNOPSIS
835
831
ARGUMENTS
836
832
JSON Path to a JSON file containing a top-level array.
837
833
838
- INDEX Position in the array where to insert the element.
834
+ INDEX Position in the array to insert the element at .
839
835
840
836
DESCRIPTION
841
837
Insert a JSON element read from standard input into a JSON array read
@@ -906,9 +902,9 @@ SYNOPSIS
906
902
$program_name os-probe [-h]
907
903
908
904
DESCRIPTION
909
- This script probes the OS, and prints details about the version. It
910
- prints three fields, delimited by ':'; the first is the package manager,
911
- the second is the OS name, and the third is the OS version.
905
+ This script probes the OS and prints three fields, delimited by ':';
906
+ the first is the package manager, the second is the OS name, the third
907
+ is the OS version.
912
908
913
909
OPTIONS
914
910
-h, --help
@@ -939,7 +935,7 @@ unit_os_probe()
939
935
local os=$( uname | tr ' [:upper:]' ' [:lower:]' )
940
936
941
937
if [ " $os " != ' linux' ] && [ " $os " != ' freebsd' ]; then
942
- err " os-probe: The OS isn't Linux or FreeBSD, can't proceed."
938
+ err " os-probe: The OS isn't Linux or FreeBSD; can't proceed."
943
939
fi
944
940
945
941
if [ " $os " = ' linux' ]; then
@@ -960,14 +956,14 @@ unit_os_probe()
960
956
local osName=$( grep " ^ID=" " $osRelease " | sed s/\" //g | awk -F= ' { print $2 }' || :)
961
957
local osVersion=$( grep ' ^VERSION_ID=' " $osRelease " | sed s/\" //g | awk -F= ' { print $2 }' || lsb_release -cs)
962
958
else
963
- err " os-probe: Unable to determine OS and version, or the OS isn't supported"
959
+ err " os-probe: Unable to determine OS and version, or the OS isn't supported. "
964
960
fi
965
961
else
966
962
local pkgMngr=' pkg' ;
967
963
local osName=$os
968
964
local osVersion=$( uname -rs | awk -F ' [ -]' ' {print $2}' || :)
969
965
if [ -z " $osVersion " ]; then
970
- err ' os-probe: Unable to get the FreeBSD version'
966
+ err ' os-probe: Unable to get the FreeBSD version. '
971
967
fi
972
968
fi
973
969
@@ -1059,8 +1055,8 @@ DESCRIPTION
1059
1055
This script configures the NGINX Unit repository for the system
1060
1056
package manager.
1061
1057
1062
- The script automatically detects your OS, and works accordingly.
1063
- However, in case the automatic selection fails, you may specify the
1058
+ The script automatically detects the OS and proceeds accordingly.
1059
+ However, if this automatic selection fails, you may specify the
1064
1060
package manager and the OS name and version.
1065
1061
1066
1062
ARGUMENTS
@@ -1071,15 +1067,15 @@ ARGUMENTS
1071
1067
Supported: 'debian', 'ubuntu', 'fedora', 'rhel', and 'amzn2'.
1072
1068
1073
1069
OS-VERSION
1074
- For most distributions this should be a numeric value, but for
1075
- debian derivatives, the codename should be used .
1070
+ For most distributions, this should be a numeric value; for
1071
+ Debian derivatives, use the codename instead .
1076
1072
1077
1073
OPTIONS
1078
1074
-h, --help
1079
1075
Print this help.
1080
1076
1081
1077
-n, --dry-run
1082
- Dry run. Print the commands to be run instea of actually
1078
+ Dry run. Print the commands to be run instead of actually
1083
1079
running them. Each command is preceded by a line explaining
1084
1080
what it does.
1085
1081
@@ -1202,7 +1198,7 @@ __EOF__";
1202
1198
installAPT " $pkg_mngr " " $os_name " ${3: +$os_version } ;
1203
1199
;;
1204
1200
* )
1205
- err " repo-config: $os_name : The OS isn't supported" ;
1201
+ err " repo-config: $os_name : The OS isn't supported. " ;
1206
1202
;;
1207
1203
esac
1208
1204
;;
@@ -1212,12 +1208,12 @@ __EOF__";
1212
1208
installYumDnf " $pkg_mngr " " $os_name " " $os_version " ${3: +ovr} ;
1213
1209
;;
1214
1210
* )
1215
- err " repo-config: $os_name : The OS isn't supported" ;
1211
+ err " repo-config: $os_name : The OS isn't supported. " ;
1216
1212
;;
1217
1213
esac ;
1218
1214
;;
1219
1215
* )
1220
- err " repo-config: $pkg_mngr : The package manager isn't supported" ;
1216
+ err " repo-config: $pkg_mngr : The package manager isn't supported. " ;
1221
1217
;;
1222
1218
esac ;
1223
1219
@@ -1239,19 +1235,19 @@ SYNOPSIS
1239
1235
+-- find [-h]
1240
1236
1241
1237
DESCRIPTION
1242
- Print the address of the control API socket of running instances of
1243
- unitd(8) .
1238
+ Print the control API socket address of running unitd(8)
1239
+ instances .
1244
1240
1245
1241
Run '$program_name sock SUBCOMMAND -h' for more information on a
1246
1242
subcommand.
1247
1243
1248
1244
SUBCOMMANDS
1249
- filter Filter the output of the 'find' subcommand, and transform it
1250
- to something suitable to run other commands, such as curl(1)
1251
- or ssh(1).
1245
+ filter Filter the output of the 'find' subcommand and transform it
1246
+ to something suitable for running other commands, such as
1247
+ curl(1) or ssh(1).
1252
1248
1253
- find Find and print the address of the control API socket of
1254
- running instances of unitd(8).
1249
+ find Find and print the control API socket address of running
1250
+ unitd(8) instances .
1255
1251
1256
1252
OPTIONS
1257
1253
-h, --help
@@ -1306,8 +1302,9 @@ SYNOPSIS
1306
1302
$program_name sock filter [-chs]
1307
1303
1308
1304
DESCRIPTION
1309
- Filter the output of the 'sock find' command, and transform it to
1310
- something suitable to run other commands, such as curl(1) or ssh(1).
1305
+ Filter the output of the 'sock find' command and transform it to
1306
+ something suitable for running other commands, such as
1307
+ curl(1) or ssh(1).
1311
1308
1312
1309
OPTIONS
1313
1310
-c, --curl
@@ -1384,8 +1381,8 @@ SYNOPSIS
1384
1381
$program_name sock find [-h]
1385
1382
1386
1383
DESCRIPTION
1387
- Find and print the address of the control API socket of running
1388
- instances of unitd(8).
1384
+ Find and print the control API socket address of running
1385
+ unitd(8) instances .
1389
1386
1390
1387
OPTIONS
1391
1388
-h, --help
0 commit comments