osm-garmin: add Containerfile
This commit is contained in:
parent
b37cf2742a
commit
e52a69735c
5 changed files with 294 additions and 0 deletions
30
osm-garmin/app/install-mkgmap.sh
Normal file
30
osm-garmin/app/install-mkgmap.sh
Normal file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
cwd="$(pwd)"
|
||||
|
||||
function install() {
|
||||
product="$1"
|
||||
version="$(curl -Ls "https://www.mkgmap.org.uk/download/$product.html" | grep "text: current().version" | sed -e "s/^[^=]*<span data-bind=\"text: current().version\">//g" | sed -e "s/<\/span>//g")"
|
||||
|
||||
cd "/tmp"
|
||||
|
||||
curl -Ls "https://www.mkgmap.org.uk/download/$product-r$version.zip" -o "$product.zip"
|
||||
|
||||
if [[ $? == 0 ]] && [[ -f "$product.zip" ]]; then
|
||||
unzip "$product.zip"
|
||||
|
||||
if [[ -d "$product-r$version" ]]; then
|
||||
mv "$product-r$version" "/opt/$product"
|
||||
rm -f "$product.zip"
|
||||
else
|
||||
exit 255
|
||||
fi
|
||||
else
|
||||
exit 255
|
||||
fi
|
||||
|
||||
cd "$cwd"
|
||||
}
|
||||
|
||||
install "mkgmap"
|
||||
install "splitter"
|
Loading…
Add table
Add a link
Reference in a new issue