diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2025-02-04 21:15:03 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2025-02-04 21:15:03 +0100 |
commit | 9ce9e21f75c67f13ccfbd5e9e874cdc56ddb108c (patch) | |
tree | 0530a71913791c265f6160811fbc2e0fc55a0977 /.local/share/bin/nginx-dev | |
parent | 296f622ed3f0fffb37f9263a2df933b883c856be (diff) |
update scripts
Diffstat (limited to '.local/share/bin/nginx-dev')
-rwxr-xr-x | .local/share/bin/nginx-dev | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/.local/share/bin/nginx-dev b/.local/share/bin/nginx-dev index 4e9825d..10987fd 100755 --- a/.local/share/bin/nginx-dev +++ b/.local/share/bin/nginx-dev @@ -21,13 +21,14 @@ options: -C enable server cache (disabled by default) -v verbose mode (prints config before starting server) -q quiet mode (disable access_log) + -x automatically open a browser -h show this help EOF exit $1 } ARGC=0 -while getopts hvp:Ct:q OPT; do +while getopts hvp:Ct:qx OPT; do [ $OPTIND -gt $ARGC ] && ARGC=$OPTIND case $OPT in h) usage 0 ;; @@ -36,6 +37,7 @@ while getopts hvp:Ct:q OPT; do v) print_config=1 ;; C) cache_control="" ;; q) access_log="/dev/null" ;; + x) open_browser=1 ;; \?|*) usage 1 ;; esac done @@ -76,6 +78,7 @@ http { } EOF [ $print_config ] && cat "$config" +[ $open_browser ] && (xdg-open "http://localhost:$port" 1> /dev/null 2> /dev/null &) nginx -c "$config" rm -f "$config" "$pidfile" |