Ticket #14230: rabbitmqctl_wrapper
File rabbitmqctl_wrapper, 317 bytes (added by tonyg-macports@…, 17 years ago) |
---|
Line | |
---|---|
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 / |
13 | exec su rabbitmq -c "@PREFIX@/sbin/rabbitmqctl_real ${CMDLINE}" |