summaryrefslogtreecommitdiff
path: root/packaging/RPMS/Fedora/rabbitmqctl_wrapper
blob: c484bb27ea15a760547b9faa3e651fb2740180ef (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/sbin/rabbitmqctl_real ${CMDLINE}"