aredn/files/etc/uci-defaults/98_change_default_maptiles

12 lines
609 B
Plaintext
Raw Normal View History

#!/bin/sh
#check for old default map tiles and change to the new map tiles if req'd
#will not change existing custom entries.
OLDTILES='http://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiazVkbHEiLCJhIjoiY2lqMnlieTM4MDAyNXUwa3A2eHMxdXE3MiJ9.BRFvx4q2vi70z5Uu2zRYQw'
NEWTILES='http://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.jpg'
MAPTILESERVER=$(/sbin/uci -c /etc/config.mesh get aredn.@map[0].maptiles)
if [ "$MAPTILESERVER" = "$OLDTILES" ]; then
/sbin/uci -c /etc/config.mesh set aredn.@map[0].maptiles="$NEWTILES"
/sbin/uci -c /etc/config.mesh commit aredn
fi
exit 0