Skip to content

Commit

Permalink
Merge pull request #3 from laconbass/master
Browse files Browse the repository at this point in the history
Fix smaugd-wsproxy for systems where 'nodejs' is 'node'.
  • Loading branch information
burzumishi authored Dec 6, 2016
2 parents bf798fa + 3a52dc9 commit efd538c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions etc/init.d/smaugd-wsproxy.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,20 @@ source @sysconfdir@/@PACKAGE@/@[email protected]
true=0;
false=1;

# dirty fix for systems having "node" instead "nodejs" as executable name
NODEJS="$($SU $USER -c 'command -v nodejs || command -v node')"
test $($NODEJS -v) == "v4.6.1" || { echo "$NODEJS -v mismatch"; exit $false; }

test -f "$PROXY_DIR/wsproxy.js" || exit $false;

set -e;

start_daemon() {
if test ! -f "$PROXY_PIDFILE"; then
($SU $USER -c "nodejs $PROXY_DIR/wsproxy.js" &>>$PROXY_LOGFILE &) &
($SU $USER -c "$NODEJS $PROXY_DIR/wsproxy.js" &>>$PROXY_LOGFILE &) &
fi;

until pidof nodejs > $PROXY_PIDFILE; do
until pidof $NODEJS > $PROXY_PIDFILE; do
sleep 2;
done;

Expand Down

0 comments on commit efd538c

Please sign in to comment.