Browse Source

Avoid bashism in extra/generic-init.d/celeryd

Ensure that "/etc/init.d/celeryd status" works on distributions
where /bin/sh isn't symlinked to /bin/bash.
Pär Wieslander 12 years ago
parent
commit
1f5b46970f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      extra/generic-init.d/celeryd

+ 2 - 1
extra/generic-init.d/celeryd

@@ -175,7 +175,8 @@ check_status () {
     for pid_file in $pid_files; do
         local node=`basename "$pid_file" .pid`
         local pid=`cat "$pid_file"`
-        if [ -z "$pid" ] || [ "${pid//[0-9]/}" ]; then
+        local cleaned_pid=`echo "$pid" | sed -e 's/[^0-9]//g'`
+        if [ -z "$pid" ] || [ "$cleaned_pid" != "$pid" ]; then
             echo "bad pid file ($pid_file)"
         else
             local failed=