mirror of
https://github.com/MinecraftServerControl/mscs.git
synced 2024-11-15 14:58:18 -07:00
Make sure the getValue method returns the default value if the file is missing
This commit is contained in:
parent
b84b0b7783
commit
1166006879
@ -470,11 +470,12 @@ getValue() {
|
||||
# Find the key/value combo.
|
||||
KEY=$($PERL -ne 'if ($_ =~ /^('$2')=.*$/i) { print lc $1; }' $1)
|
||||
VALUE=$($PERL -ne 'if ($_ =~ /^'$2'=(.*)$/i) { print $1; }' $1)
|
||||
if [ -n "$KEY" ] && [ -n "$VALUE" ]; then
|
||||
echo "$VALUE"
|
||||
else
|
||||
echo "$3"
|
||||
fi
|
||||
fi
|
||||
# Return the value if found, the default value if not.
|
||||
if [ -n "$KEY" ] && [ -n "$VALUE" ]; then
|
||||
echo "$VALUE"
|
||||
else
|
||||
echo "$3"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user