Browse Source

Merge pull request #2923 from cjh1/celeryd-fix

Replace use of 'if [[...]]' not supported in sh
Ask Solem Hoel 9 năm trước cách đây
mục cha
commit
6df7042249
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      extra/generic-init.d/celeryd

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

@@ -37,9 +37,14 @@ if [ $(id -u) -ne 0 ]; then
     exit 1
 fi
 
+origin_is_runlevel_dir () {
+    set +e
+    dirname $0 | grep -q "/etc/rc.\.d"
+    echo $?
+}
 
 # Can be a runlevel symlink (e.g. S02celeryd)
-if [[ `dirname $0` == /etc/rc*.d ]]; then
+if [ $(origin_is_runlevel_dir) -eq 0 ]; then
     SCRIPT_FILE=$(readlink "$0")
 else
     SCRIPT_FILE="$0"