2
0
Fork 0
containerfiles/osm-garmin/app/install-mkgmap.sh

30 lines
730 B
Bash
Raw Normal View History

2023-09-26 03:13:31 +02:00
#!/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"