Jelajahi Sumber

Fixes commands setting vars not working

Some commands that require setting a variable, like "force-update" wouldn't work without this "eval" argument.

Example:
````
$ ./insserver fu
/home/insserver/lgsm/functions/core_getopt.sh: line 176: forceupdate=1;: command not found
````
This fixes the issue.

Tested on Debian & Ubuntu.
UltimateByte 9 tahun lalu
induk
melakukan
e5b77379e0
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      lgsm/functions/core_getopt.sh

+ 2 - 2
lgsm/functions/core_getopt.sh

@@ -173,7 +173,7 @@ for i in "${optcommands[@]}"; do
 			for ((currcmdindex=1; currcmdindex <= ${currcmdamount}; currcmdindex++)); do
 			for ((currcmdindex=1; currcmdindex <= ${currcmdamount}; currcmdindex++)); do
 				if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then
 				if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then
 					# Run command
 					# Run command
-					${currentopt[index+1]}
+					eval ${currentopt[index+1]}
 					core_exit.sh
 					core_exit.sh
 					break
 					break
 				fi
 				fi
@@ -186,4 +186,4 @@ done
 echo -e "${red}Unknown command${default}: $0 ${getopt}"
 echo -e "${red}Unknown command${default}: $0 ${getopt}"
 exitcode=2
 exitcode=2
 fn_opt_usage
 fn_opt_usage
-core_exit.sh
+core_exit.sh