Permalink
Browse files

Added node -> bash config parser for shell scripts

  • Loading branch information...
1 parent ed4bd61 commit fd46055db4123d3dce5c6a9e23dc38526e8293ac @davglass committed Feb 28, 2011
Showing with 48 additions and 11 deletions.
  1. +1 −0 .gitignore
  2. +8 −2 bin/app_start.sh
  3. +8 −2 bin/app_stop.sh
  4. +16 −0 bin/node-config.js
  5. +7 −4 bin/proxy_start.sh
  6. +8 −3 bin/proxy_stop.sh
View
@@ -4,3 +4,4 @@ config.js
proxy/.monitor
scripts/gitrepoclone.sh
ssl/*
+bin/.nodester.config
View
@@ -1,9 +1,15 @@
#!/bin/bash
-export HOME=/var/nodester;
+cd `dirname $0`
+
+./node-config.js
+wait
+source ./.nodester.config
+
+export HOME=$HOME_DIR;
export PATH="/usr/local/bin:${PATH}";
-APPDIR=$HOME/nodester
+APPDIR=$APP_DIR
FHOME=$HOME/forever-app/
View
@@ -1,9 +1,15 @@
#!/bin/bash
-export HOME=/var/nodester;
+cd `dirname $0`
+
+./node-config.js
+wait
+source ./.nodester.config
+
+export HOME=$HOME_DIR;
export PATH="/usr/local/bin:${PATH}";
-APPDIR=$HOME/nodester;
+APPDIR=$APP_DIR
FHOME=$HOME/forever-app
View
@@ -0,0 +1,16 @@
+#!/usr/bin/env node
+
+process.chdir(__dirname);
+
+var config = require('../config').opt;
+var fs = require('fs');
+
+var data = [];
+
+for (var i in config) {
+ if (typeof config[i] == 'string') {
+ data.push('export ' + i.toUpperCase() + '=' + config[i]);
+ }
+}
+
+fs.writeFileSync('./.nodester.config', data.join('\n'), encoding='utf8');
View
@@ -5,12 +5,16 @@ if [ "$USER" != "root" ]; then
exit
fi
+cd `dirname $0`
-export HOME=/var/nodester;
-export PATH="/usr/local/bin:${PATH}";
+./node-config.js
+wait
+source ./.nodester.config
-APPDIR=$HOME/nodester/proxy
+export HOME=$HOME_DIR;
+export PATH="/usr/local/bin:${PATH}";
+APPDIR=$APP_DIR
FHOME=$HOME/forever-proxy/
@@ -28,5 +32,4 @@ if [ -f $FHOME/logs/forever.log ]; then
fi
ulimit -n 99999;
-echo "forever start -l forever.log -o app-out.log -e app-err.log -d $APPDIR -p $FHOME proxy.js"
forever start -l logs/forever.log -o $FHOME/logs/proxy-out.log -e $FHOME/logs/proxy-err.log -d $APPDIR -p $FHOME proxy.js
View
@@ -5,11 +5,16 @@ if [ "$USER" != "root" ]; then
exit
fi
-export HOME=/var/nodester;
-export PATH="/usr/local/bin:${PATH}";
+cd `dirname $0`
+
+./node-config.js
+wait
+source ./.nodester.config
-APPDIR=$HOME/nodester;
+export HOME=$HOME_DIR;
+export PATH="/usr/local/bin:${PATH}";
+APPDIR=$APP_DIR
FHOME=$HOME/forever-proxy

0 comments on commit fd46055

Please sign in to comment.