From af66e39769de51d48172bee622072e700ffe9eed Mon Sep 17 00:00:00 2001 From: Joseph Snow Date: Tue, 15 Nov 2011 09:15:56 -0700 Subject: [PATCH] updating script for boot/restart --- start | 8 ++++++-- util/reboot-restart.sh | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/start b/start index dcb1c34..8d8c89b 100755 --- a/start +++ b/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 & diff --git a/util/reboot-restart.sh b/util/reboot-restart.sh index d358ef4..459cabc 100644 --- a/util/reboot-restart.sh +++ b/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 -- 2.25.1