Sfoglia il codice sorgente

[fix] improve argument parsing of manage.sh

Thomas Pointhuber 9 anni fa
parent
commit
ceb70ccb5d
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2
    2
      manage.sh

+ 2
- 2
manage.sh Vedi File

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