Last active
October 26, 2015 22:53
-
-
Save stevenmaguire/61d1a59f4ee20560ccc2 to your computer and use it in GitHub Desktop.
Get current nginx configuration directory from configure flags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NGINX_CONFIG_DIRECTORY=$(2>&1 nginx -V | tr ' ' '\n' | grep -E -- '--conf-path=(.*)' | cut -d '=' -f 2 | sed -r 's/\/nginx\.conf//g') | |
# ALTERNATE | |
NGINX_CONFIG_DIRECTORY=$(nginx -V 2>&1 |tail -1|tr \ \\n|grep conf-path|tr = \\n|tail -1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment