summaryrefslogtreecommitdiff
path: root/packaging/RPMS/Fedora/rabbitmqctl_wrapper
blob: 75b37c0d6c792900f765d3c019411171abfc89c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
# Escape spaces and quotes, because shell is revolting.
for arg in "$@" ; do
	# Escape quotes in parameters, so that they're passed through cleanly.
	arg=$(sed -e 's/"/\\"/' <<-END
		$arg
		END
	)
	CMDLINE="${CMDLINE} \"${arg}\""
done

cd /
su rabbitmq -s /bin/sh -c "/usr/lib/rabbitmq/bin/rabbitmqctl ${CMDLINE}"