Problem:
Since mumble_server_config.ini is recreated every time, users of the old database filename murmur.sqlite will have their existing database ignored by the new default configuration setting.
Solution:
If the old murmur.sqlite database file exists in ${DATA_DIR}, use that as the database file.
This should cleanly support users of the old database.
With mumble-voip/mumble#5838 the file structure
of the upstream repo has changed slightly and most importantly the
location of the default server ini file has changed as well. Thus, we
now have to check multiple locations inside our Dockerfile in order to
make it work with the old and the new layout.
With https://github.com/mumble-voip/mumble/pull/5838 the file structure
of the upstream repo has changed slightly and most importantly the
location of the default server ini file has changed as well. Thus, we
now have to check multiple locations inside our Dockerfile in order to
make it work with the old and the new layout.
Add a function to "normalize" the name of config options that will be
used, while using sed instead of grep to both retrieve and manipulate
the names of environment variables that start with MUMBLE_CONFIG_.
Remove any possible underscores from the config options when creating
keys for the associative array used to look them up after capturing
environment variables.
This is a possible regression from fc0363a.
Use Bash's associative array for the existing configuration options and
for the translation of something like "DBUSER" to "dbUser", replacing
the for loop that existed before.
Redirect multiple commands to the configuration file instead of making
multiple redirects, potentially limiting the number of times the file
needs to be opened for appending. (SC2129)
Use "${arr[*]}" not to mix array and string. (SC2145)
Remove most comments and shorten some others. Focus should be on making
code clean and immediately readable instead of documented directly in
the script file.
Remove trailing whitespace while there isn't much. This is discouraged,
since it can mess with git-blame information, but it irks me there is
trailing whitespace.
This commit might be dropped if requested during review. :(
Replace the standard POSIX test command ([]) with Bash's builtin ([[]])
for consistency.
There was a single use of the double bracket syntax, but since the
script references Bash in its shebang, we might as well use it instead
of the POSIX one.
Use grep to fetch only environment variables that start with
`MUMBLE_CONFIG_`, rather than manually compare in an if statement,
getting rid of one level of indentation.