Skip to content

Commit

Permalink
Fixes commands setting vars not working
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
UltimateByte authored Mar 8, 2017
1 parent fea406c commit e5b7737
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lgsm/functions/core_getopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ for i in "${optcommands[@]}"; do
for ((currcmdindex=1; currcmdindex <= ${currcmdamount}; currcmdindex++)); do
if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then
# Run command
${currentopt[index+1]}
eval ${currentopt[index+1]}
core_exit.sh
break
fi
Expand All @@ -186,4 +186,4 @@ done
echo -e "${red}Unknown command${default}: $0 ${getopt}"
exitcode=2
fn_opt_usage
core_exit.sh
core_exit.sh

0 comments on commit e5b7737

Please sign in to comment.