Permalink
Browse files

updating script for boot/restart

  • Loading branch information...
1 parent 11583c8 commit af66e39769de51d48172bee622072e700ffe9eed @josephsnow josephsnow committed Nov 15, 2011
Showing with 7 additions and 3 deletions.
  1. +6 −2 start
  2. +1 −1 util/reboot-restart.sh
View
8 start
@@ -3,9 +3,13 @@
ps waux | grep node | grep -v grep
echo "starting ..."
-## note: start as root, pass env vars to sudo param, this app will downgrade itself once it has initialized
-sudo -E forever app.js &> log.txt &
+if [ "$(id -u)" != "0" ]; then
+ ## note: start as root, pass env vars to sudo param, this app will downgrade itself once it has initialized
+ sudo -E forever app.js &> log.txt &
+else
+ forever app.js &> log.txt &
+fi
cd etherpad-lite/node
forever server.js &> log.txt &
View
2 util/reboot-restart.sh
@@ -12,6 +12,6 @@ rm /data/db/mongod.lock
pushd .
cd /home/ec2-user/fc
-cat restart | sudo -u ec2-user sh
+./restart
popd

0 comments on commit af66e39

Please sign in to comment.