Skip to content

Commit e5b7737

Browse files
authored
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.
1 parent fea406c commit e5b7737

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lgsm/functions/core_getopt.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ for i in "${optcommands[@]}"; do
173173
for ((currcmdindex=1; currcmdindex <= ${currcmdamount}; currcmdindex++)); do
174174
if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then
175175
# Run command
176-
${currentopt[index+1]}
176+
eval ${currentopt[index+1]}
177177
core_exit.sh
178178
break
179179
fi
@@ -186,4 +186,4 @@ done
186186
echo -e "${red}Unknown command${default}: $0 ${getopt}"
187187
exitcode=2
188188
fn_opt_usage
189-
core_exit.sh
189+
core_exit.sh

0 commit comments

Comments
 (0)