summaryrefslogtreecommitdiff
path: root/nginx.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nginx.sh')
-rwxr-xr-xnginx.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/nginx.sh b/nginx.sh
index 800165e..cb8c6b6 100755
--- a/nginx.sh
+++ b/nginx.sh
@@ -26,7 +26,7 @@ if [ ! -e "$GIT" ]; then
fi
-LOG="/tmp/`basename $0`-log.txt"
+LOG="$HOME/tmp/`basename $0`-log.txt"
echo
echo "Nginx ('$LOG'):"
@@ -53,7 +53,15 @@ servername=`hostname`
$GIT checkout nginx.conf>>$LOG 2>&1
cmd="sed -i -e \"s,PASSENGER,$passenger,;s,SERVERNAME,$servername,;s,RUBY_DEST,$RUBY_DEST,;s,NGINX_DEST,$NGINX_DEST,;s,WWW_DEST,$WWW_DEST,\" ./nginx.conf" && run_cmd "$cmd" "Config"
cmd="sed -i -e \"s,USER,`whoami`,\" ./nginx.conf" && run_cmd "$cmd" "User"
+
+if [ -z "$NGINX_PORT" ]; then
+ NGINX_PORT=80
+else
+ NGINX_PORT=`echo "$NGINX_PORT" | sed 's/^.//g'`
+fi
+cmd="sed -i -e \"s,NGINX_PORT,$NGINX_PORT,\" ./nginx.conf" && run_cmd "$cmd" "NGINX_PORT"
cmd="cp ./nginx.conf \"$NGINX_DEST/conf\"" && run_cmd "$cmd" "Copy"
+$GIT checkout nginx.conf>>$LOG 2>&1
if [ ! -f $NGINX_CONF ]; then
echo "if ! echo \"\$PATH\" | grep \"$NGINX_DEST\">/dev/null 2>&1; then export PATH=$NGINX_DEST/sbin:\$PATH; fi" >> "$NGINX_CONF"