2 ## The contents of this file are subject to the Mozilla Public License
3 ## Version 1.1 (the "License"); you may not use this file except in
4 ## compliance with the License. You may obtain a copy of the License at
5 ## http://www.mozilla.org/MPL/
7 ## Software distributed under the License is distributed on an "AS IS"
8 ## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
9 ## License for the specific language governing rights and limitations
12 ## The Original Code is RabbitMQ.
14 ## The Initial Developers of the Original Code are LShift Ltd,
15 ## Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd.
17 ## Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd,
18 ## Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd
19 ## are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
20 ## Technologies LLC, and Rabbit Technologies Ltd.
22 ## Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
23 ## Ltd. Portions created by Cohesive Financial Technologies LLC are
24 ## Copyright (C) 2007-2009 Cohesive Financial Technologies
25 ## LLC. Portions created by Rabbit Technologies Ltd are Copyright
26 ## (C) 2007-2009 Rabbit Technologies Ltd.
28 ## All Rights Reserved.
30 ## Contributor(s): ______________________________________.
33 # Escape spaces and quotes, because shell is revolting.
35 # Escape quotes in parameters, so that they're passed through cleanly.
36 arg
=$
(sed -e 's/"/\\"/g' <<-END
40 CMDLINE
="${CMDLINE} \"${arg}\""
47 if [ `id -u` = 0 ] ; then
48 su rabbitmq
-s /bin
/sh
-c "/usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}"
50 /usr
/lib
/rabbitmq
/bin
/${SCRIPT}
51 echo -e "\nOnly root should run ${SCRIPT}\n"