Skip to content

Commit fb34a73

Browse files
author
Sam J Sharpe
committed
Add tasks to start and restart nginx
1 parent af04124 commit fb34a73

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

nginx.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,14 @@ def gracefulstop(wait=True):
88
if wait:
99
# Poll for Nginx, until it's no longer running.
1010
run('while pgrep nginx >/dev/null; do echo "Waiting for Nginx to exit.."; sleep 1; done')
11+
12+
@task
13+
def gracefulstart():
14+
"""Start up Nginx on a machine"""
15+
sudo('service nginx start')
16+
17+
@task
18+
def hello_it():
19+
"""Turns Nginx off and on again"""
20+
gracefulstop()
21+
gracefulstart()

0 commit comments

Comments
 (0)