We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba0ef93 commit 7851f13Copy full SHA for 7851f13
packaging/macports/net/rabbitmq-server/files/rabbitmq-script-wrapper
@@ -0,0 +1,23 @@
1
+#!/bin/bash
2
+# Escape spaces and quotes, because shell is revolting.
3
+for arg in "$@" ; do
4
+ # Escape quotes in parameters, so that they're passed through cleanly.
5
+ arg=$(sed -e 's/"/\\"/' <<-END
6
+ $arg
7
+ END
8
+ )
9
+ CMDLINE="${CMDLINE} \"${arg}\""
10
+done
11
+
12
+cd /var/lib/rabbitmq
13
14
+SCRIPT=`basename $0`
15
16
+if [ `id -u` = 0 ] ; then
17
+ su rabbitmq -s /bin/sh -c "/usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}"
18
+else
19
+ /usr/lib/rabbitmq/bin/${SCRIPT}
20
+ echo -e "\nOnly root should run ${SCRIPT}\n"
21
+ exit 1
22
+fi
23
packaging/macports/net/rabbitmq-server/files/rabbitmqctl_wrapper
0 commit comments