Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove bashisms from shell scripts which use /bin/sh

Fixes #140

`type -p` is not supported by /bin/sh and caused the riak and riak-admin scripts
to think that `sudo` was not available.  In addition `kill -SIGNAL` is not portable
to /bin/sh and should be replaced by `kill -s SIGNAL` instead.

The portability was checked with `checkbashisms` from the devscripts package in
ubuntu 10.04 and was tested on /bin/sh in solaris, ubuntu, and OSX.
  • Loading branch information...
commit 24176a74757b49df0db96b128fd991004896d8cb 1 parent 713e9fd
@jaredmorrow jaredmorrow authored
Showing with 4 additions and 4 deletions.
  1. +2 −2 rel/files/riak
  2. +1 −1  rel/files/riak-admin
  3. +1 −1  rel/files/search-cmd
View
4 rel/files/riak
@@ -26,7 +26,7 @@ RIAK_VERSION="git"
# Make sure this script is running as the appropriate user
if [ "$RUNNER_USER" -a "x$LOGNAME" != "x$RUNNER_USER" ]; then
- type -p sudo > /dev/null 2>&1
+ type sudo > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "sudo doesn't appear to be installed and your EUID isn't $RUNNER_USER" 1>&2
exit 1
@@ -171,7 +171,7 @@ case "$1" in
if [ "$ES" -ne 0 ]; then
exit $ES
fi
- while `kill -0 $PID 2>/dev/null`;
+ while `kill -s 0 $PID 2>/dev/null`;
do
sleep 1
done
View
2  rel/files/riak-admin
@@ -19,7 +19,7 @@ RUNNER_USER={{runner_user}}
# Make sure this script is running as the appropriate user
if [ "$RUNNER_USER" -a "x$LOGNAME" != "x$RUNNER_USER" ]; then
- type -p sudo > /dev/null 2>&1
+ type sudo > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "sudo doesn't appear to be installed and your EUID isn't $RUNNER_USER" 1>&2
exit 1
View
2  rel/files/search-cmd
@@ -19,7 +19,7 @@ RUNNER_USER={{runner_user}}
# Make sure this script is running as the appropriate user
if [ "$RUNNER_USER" -a "x$LOGNAME" != "x$RUNNER_USER" ]; then
- type -p sudo > /dev/null 2>&1
+ type sudo > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "sudo doesn't appear to be installed and your EUID isn't $RUNNER_USER" 1>&2
exit 1
Please sign in to comment.
Something went wrong with that request. Please try again.