Skip to content

Commit 4b59310

Browse files
author
António P. P. Almeida
committed
* Fix startup program name.
1 parent 7659af0 commit 4b59310

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

bin/nginx_ensite

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ else
4040
NGINX=/usr/sbin/nginx
4141
fi
4242

43-
## Default values.
43+
## Default value for the configuration directory.
4444
NGINX_CONF_DIR=/etc/nginx
45-
STARTUP_PROGRAM_NAME=service
4645

4746
function print_usage() {
4847
echo "$SCRIPTNAME [-c <nginx configuration base directory> default: /etc/nginx] [ -s <startup program name> default: service] <site name>"
@@ -58,10 +57,12 @@ function get_startup_program_name() {
5857

5958
[[ $1 =~ [[:alnum:]/-]]+nginx$ ]] && value="$1 -s reload"
6059

61-
echo "$value"
62-
60+
echo "$value"
6361
}
6462

63+
## The default start up program is service.
64+
STARTUP_PROGRAM_NAME=$(get_startup_program_name service)
65+
6566
## Create the relative path to the vhost file.
6667
## $1: configuration file name (usually the vhost)
6768
## $2: available sites directory name (usually sites-available)

0 commit comments

Comments
 (0)