Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support for script file without extension in init script

  • Loading branch information...
commit e2c88fa6e40a84991fa7080dd39eaea2240f0998 1 parent db5660b
Dmitry Koterov authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 dklab_realplexor.init
8 dklab_realplexor.init
View
@@ -50,7 +50,11 @@ fi
[ -f /etc/sysconfig/${NAME} ] && . /etc/sysconfig/${NAME}
# Script to execute.
-BIN="$CWD/dklab_realplexor.pl"
+if [ -x $CWD/dklab_realplexor ]; then
+ BIN="$CWD/dklab_realplexor"
+else
+ BIN="/usr/bin/perl $CWD/dklab_realplexor.pl"
+fi
start () {
@@ -62,7 +66,7 @@ start () {
echo "dklab_realplexor for $CONF is already running"
else
rm -f $PIDFILE 2>/dev/null
- cd $CWD && /usr/bin/perl $BIN $CONF -p $PIDFILE 2>&1 | logger -p `eval "echo $LOGPRI"` -t `eval "echo $LOGTAG"` &
+ cd $CWD && $BIN $CONF -p $PIDFILE 2>&1 | logger -p `eval "echo $LOGPRI"` -t `eval "echo $LOGTAG"` &
sleep 1
PID=`cat $PIDFILE 2>/dev/null`
if [ "$PID" != "" ]; then
Please sign in to comment.
Something went wrong with that request. Please try again.