forked from mumble-voip/mumble-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR mumble-voip#19: Make Dockerfile compatible to latest upstrea…
…m layout 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.
- Loading branch information
Showing
3 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script can be used to copy the first existing file to the | ||
# target destination. | ||
# Thus | ||
# copy_one_of.sh a b c | ||
# copies either a or b to c. The first of the target files that | ||
# exists will be copied. The rest will be ignored. | ||
|
||
set -e | ||
set -x | ||
|
||
if [[ "$#" < 2 ]]; then | ||
>&2 echo "Too few arguments - expected at least two" | ||
exit 1 | ||
fi | ||
|
||
parameters=( "$@" ) | ||
target_file="${parameters[$(( $# - 1))]}" | ||
|
||
found=false | ||
|
||
# Make use of num. of arguments $# to iterate up to the i - 1st argument (last one is destination) | ||
for i in $(seq 0 $(( $# - 2 )) ); do | ||
current_file=${parameters[$i]} | ||
|
||
if [[ -f "$current_file" ]]; then | ||
cp "$current_file" "$target_file" | ||
found=true | ||
break | ||
fi | ||
done | ||
|
||
if [[ "$found" = "false" ]]; then | ||
>&2 echo "Did not find any of the source files - nothing was copied" | ||
exit 1 | ||
fi |