Browse Source

[fix] posix compatibility

Adam Tauber 9 years ago
parent
commit
1d5afa4ccc
1 changed files with 4 additions and 6 deletions
  1. 4 6
      manage.sh

+ 4 - 6
manage.sh

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