mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
a5c96be8b7
Change-Id: I92c536af60613705229faea97a26d1486d4730a1
17 lines
443 B
Bash
Executable file
17 lines
443 B
Bash
Executable file
#!/bin/sh
|
|
# Wrapper for Parsoid web service (server.js and ParserService.js)
|
|
|
|
# redirect port 80 to unprivileged port 8000
|
|
if ! `iptables -tnat -L | grep -q 'tcp dpt:http redir ports 8000'`;then
|
|
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
|
|
fi
|
|
|
|
# update the source
|
|
git pull
|
|
|
|
# kill a running server (crude version..)
|
|
killall node
|
|
|
|
# run the server as non-privileged user
|
|
nohup sudo -u nobody node server.js &
|