Created
July 21, 2018 17:35
-
-
Save Voronenko/44f11d562c87427da4cd732bedabb54c to your computer and use it in GitHub Desktop.
Validates test config
This file contains hidden or 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 | |
# | |
# validate nginx config | |
# | |
# based on script by Paul Downey | |
# https://gist.github.com/psd/5042334 | |
test_conf=`mktemp` | |
target_conf=$1 | |
cat > $test_conf <<-! | |
events { | |
worker_connections 512; | |
} | |
http { | |
include $target_conf; | |
} | |
! | |
PATH=/usr/sbin:/usr/local/sbin nginx -t -c $test_conf | |
rc=$? | |
rm "$test_conf" | |
exit $rc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment