]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2225] fix argument check in admin-utils.sh
authorAndrei Pavel <andrei@isc.org>
Sun, 23 Jan 2022 12:52:45 +0000 (14:52 +0200)
committerFrancis Dupont <fdupont@isc.org>
Mon, 24 Jan 2022 15:57:59 +0000 (16:57 +0100)
src/bin/admin/admin-utils.sh

index c5e2b2d72850eba67b10175f33031a21b7aaef26..91b401286d1fc02bbb34cc7e89ea44312b64164e 100644 (file)
@@ -70,7 +70,7 @@ mysql_execute() {
 
     mysql_sanity_checks
 
-    if [ $# -gt 1 ]; then
+    if [ $# -gt 0 ]; then
         mysql -N -B --host="${db_host}" ${db_port_full_parameter-} \
         --database="${db_name}" --user="${db_user}" \
         --password="${db_password}" ${extra_arguments} \
@@ -94,7 +94,7 @@ mysql_execute_script() {
 
     mysql_sanity_checks
 
-    if [ $# -ge 1 ]; then
+    if [ $# -gt 0 ]; then
         mysql -N -B --host="${db_host}" ${db_port_full_parameter-} \
         --database="${db_name}" --user="${db_user}" \
         --password="${db_password}" ${extra_arguments} "${@}" < "${file}"