Changes

Jump to navigation Jump to search
Line 35: Line 35:  
   local CMD="$SCRIPT &> \"$LOGFILE\" & echo \$!"
 
   local CMD="$SCRIPT &> \"$LOGFILE\" & echo \$!"
 
   su -c "$CMD" $RUNAS > "$PIDFILE"
 
   su -c "$CMD" $RUNAS > "$PIDFILE"
 +
  sleep 2
 +
  PID=$(cat $PIDFILE)
 
     if pgrep -u $RUNAS -f $NAME > /dev/null
 
     if pgrep -u $RUNAS -f $NAME > /dev/null
 
     then
 
     then
       echo "$NAME is now running."
+
       echo "$NAME is now running, the PID is $PID"
 
     else
 
     else
 
       echo "Error! Could not start $NAME!"
 
       echo "Error! Could not start $NAME!"
 
     fi
 
     fi
 +
 
  }
 
  }
 
   
 
   

Navigation menu