Przeglądaj źródła

[fix] posix compatibility

Adam Tauber 9 lat temu
rodzic
commit
1d5afa4ccc
1 zmienionych plików z 4 dodań i 6 usunięć
  1. 4
    6
      manage.sh

+ 4
- 6
manage.sh Wyświetl plik

@@ -71,7 +71,7 @@ locales() {
71 71
 }
72 72
 
73 73
 help() {
74
-    [ -z "$1" ] || echo -e "Error: $1\n"
74
+    [ -z "$1" ] || printf "Error: $1\n"
75 75
     echo "Searx manage.sh help
76 76
 
77 77
 Commands
@@ -90,8 +90,6 @@ Commands
90 90
 "
91 91
 }
92 92
 
93
-if [ -n "$(type -t $ACTION)" ] && [ "$(type -t $ACTION)" = function ]; then
94
-    $ACTION
95
-else
96
-    help "action not found"
97
-fi
93
+[ "$(command -V "$ACTION" | grep ' function$')" != "" ] \
94
+    && $ACTION \
95
+    || help "action not found"