summaryrefslogtreecommitdiff
path: root/nginx.sh
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2011-03-29 13:06:32 +0200
committerAndreas Maunz <andreas@maunz.de>2011-03-29 13:06:32 +0200
commit78a251a002390dafd1f26271e9b8a531fb9aea14 (patch)
tree8bf3c5b3c77e7e4fdffa3b555224046ac517af8b /nginx.sh
parent424abba2902b71ce95b07f550f2c2841d13265ee (diff)
Nginx fix: ENV variable
Diffstat (limited to 'nginx.sh')
-rwxr-xr-xnginx.sh37
1 files changed, 31 insertions, 6 deletions
diff --git a/nginx.sh b/nginx.sh
index 43a4a3e..e528d8b 100755
--- a/nginx.sh
+++ b/nginx.sh
@@ -17,10 +17,35 @@ if [ ! -e "$PIN" ]; then
fi
source ./config.sh
-$PIN --auto-download --auto --prefix="$NGINX_DEST"
-cd $RUBY_DEST/lib/ruby/gems/1.8/gems/
-passenger=`ls -d passenger*`;
-cd -
-servername=`hostname`.`dnsdomainname`
-sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/" ./nginx.conf > $NGINX_DEST/nginx.conf
+
+echo "This installs Nginx."
+echo "Press <Return> to continue, or <Ctrl+C> to abort."
+read
+
+DIR="`pwd`"
+
+NGINX_DONE=false
+mkdir "$NGINX_DEST" >/dev/null 2>&1
+if [ ! -d "$NGINX_DEST" ]; then
+ echo "Install directory '$KL_DEST' is not available! Aborting..."
+ exit 1
+else
+ if ! rmdir "$KL_DEST" >/dev/null 2>&1; then # if not empty this will fail
+ echo "Install directory '$KL_DEST' is not empty. Skipping kernlab installation..."
+ NGINX_DONE=true
+ fi
+fi
+
+if ! $NGINX_DONE; then
+ $PIN --auto-download --auto --prefix="$NGINX_DEST"
+ cd "$RUBY_DEST/lib/ruby/gems/1.8/gems/"
+ passenger=`ls -d passenger*`;
+ cd -
+ servername=`hostname`.`dnsdomainname`
+ sed -e "s/PASSENGER/$passenger/;s/SERVERNAME/$servername/" ./nginx.conf > $NGINX_DEST/nginx.conf
+fi
+
+cd "$DIR"
+echo
+echo "Nginx installation finished."