Permalink
Browse files

Add nginx_with_sudo to run nginx locally with sudo

  • Loading branch information...
1 parent 2d5d4ae commit 7f12cbcd1b2208073061dfbfc49e2a78c81829ad Naoto Kaneko committed Apr 24, 2013
Showing with 14 additions and 0 deletions.
  1. +14 −0 nginx_with_sudo
View
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+NGINX_BIN="/usr/local/sbin/nginx"
+
+function on_die() {
+ sudo $NGINX_BIN -s stop
+ exit 0
+}
+
+trap on_die TERM
+
+sudo $NGINX_BIN $@ &
+
+wait

0 comments on commit 7f12cbc

Please sign in to comment.