Skip to content

Commit

Permalink
add explicit -p option for port to boot scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dzuelke committed Nov 10, 2014
1 parent 63b4c54 commit 1f97ed2
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
9 changes: 8 additions & 1 deletion bin/heroku-hhvm-apache2
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ Options:
exist, it will be created. Wildcards are allowed, but
must be quoted and must match already existing files.
Note: this option can be repeated multiple times.
-p <PORT> Port to listen on for HTTP traffic. If this argument
is not given, then the port number to use is read from
the \$PORT environment variable, or a random port is
chosen if that variable does not exist.
-v, --verbose Be more verbose during startup.
All file paths must be relative to '$HEROKU_APP_DIR'.
Expand All @@ -91,7 +95,7 @@ export PORT=${PORT:-$(( $RANDOM+1024 ))}
# our standard logs
logs=( "/tmp/heroku.apache2_error.$PORT.log" "/tmp/heroku.apache2_access.$PORT.log" )

optstring=":-:C:c:i:l:vh"
optstring=":-:C:c:i:l:p:vh"

# process flags first
while getopts "$optstring" opt; do
Expand Down Expand Up @@ -149,6 +153,9 @@ while getopts "$optstring" opt; do
logs+=("$logfile") # must quote here in case a wildcard matched a file with a space in the name
done
;;
p)
PORT="$OPTARG"
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 2
Expand Down
9 changes: 8 additions & 1 deletion bin/heroku-hhvm-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ Options:
exist, it will be created. Wildcards are allowed, but
must be quoted and must match already existing files.
Note: this option can be repeated multiple times.
-p <PORT> Port to listen on for HTTP traffic. If this argument
is not given, then the port number to use is read from
the \$PORT environment variable, or a random port is
chosen if that variable does not exist.
-v, --verbose Be more verbose during startup.
All file paths must be relative to '$HEROKU_APP_DIR'.
Expand All @@ -92,7 +96,7 @@ export PORT=${PORT:-$(( $RANDOM+1024 ))}
# our standard logs
logs=( "/tmp/heroku.nginx_access.$PORT.log" )

optstring=":-:C:c:i:l:vh"
optstring=":-:C:c:i:l:p:vh"

# process flags first
while getopts "$optstring" opt; do
Expand Down Expand Up @@ -150,6 +154,9 @@ while getopts "$optstring" opt; do
logs+=("$logfile") # must quote here in case a wildcard matched a file with a space in the name
done
;;
p)
PORT="$OPTARG"
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 2
Expand Down
9 changes: 8 additions & 1 deletion bin/heroku-php-apache2
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ Options:
exist, it will be created. Wildcards are allowed, but
must be quoted and must match already existing files.
Note: this option can be repeated multiple times.
-p <PORT> Port to listen on for HTTP traffic. If this argument
is not given, then the port number to use is read from
the \$PORT environment variable, or a random port is
chosen if that variable does not exist.
-v, --verbose Be more verbose during startup.
All file paths must be relative to '$HEROKU_APP_DIR'.
Expand All @@ -106,7 +110,7 @@ export PORT=${PORT:-$(( $RANDOM+1024 ))}
# our standard logs
logs=( "/tmp/heroku.php-fpm.$PORT.log" "/tmp/heroku.php-fpm.www.$PORT.log" "/tmp/heroku.apache2_error.$PORT.log" "/tmp/heroku.apache2_access.$PORT.log" )

optstring=":-:C:c:F:f:i:l:vh"
optstring=":-:C:c:F:f:i:l:p:vh"

# process flags first
while getopts "$optstring" opt; do
Expand Down Expand Up @@ -170,6 +174,9 @@ while getopts "$optstring" opt; do
logs+=("$logfile") # must quote here in case a wildcard matched a file with a space in the name
done
;;
p)
PORT="$OPTARG"
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 2
Expand Down
9 changes: 8 additions & 1 deletion bin/heroku-php-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ Options:
exist, it will be created. Wildcards are allowed, but
must be quoted and must match already existing files.
Note: this option can be repeated multiple times.
-p <PORT> Port to listen on for HTTP traffic. If this argument
is not given, then the port number to use is read from
the \$PORT environment variable, or a random port is
chosen if that variable does not exist.
-v, --verbose Be more verbose during startup.
All file paths must be relative to '$HEROKU_APP_DIR'.
Expand All @@ -107,7 +111,7 @@ export PORT=${PORT:-$(( $RANDOM+1024 ))}
# our standard logs
logs=( "/tmp/heroku.php-fpm.$PORT.log" "/tmp/heroku.php-fpm.www.$PORT.log" "/tmp/heroku.nginx_access.$PORT.log" )

optstring=":-:C:c:F:f:i:l:vh"
optstring=":-:C:c:F:f:i:l:p:vh"

# process flags first
while getopts "$optstring" opt; do
Expand Down Expand Up @@ -171,6 +175,9 @@ while getopts "$optstring" opt; do
logs+=("$logfile") # must quote here in case a wildcard matched a file with a space in the name
done
;;
p)
PORT="$OPTARG"
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 2
Expand Down

0 comments on commit 1f97ed2

Please sign in to comment.