#!/bin/sh
#
# Quick for building memory disk cache file
#
# Meant to be used in crontab like this:
#     @reboot root /usr/local/django_gheat/init_ramdisk.sh
#
# Rick van der Zwet <rick@wirelessleiden.nl>
#
MD=`mdconfig -a -t malloc -s 1g` || exit 1
newfs /dev/$MD
mount -o rw,noatime /dev/$MD /usr/local/var
mkdir -p /usr/local/var/django/cache/{osm_proxy,tile}
mkdir -p /usr/local/var/scan-data
mkdir -p /usr/local/var/httpd/cache/{osmproxy,maps}
chown -R www:www /usr/local/var/*

/usr/local/etc/rc.d/apache22 restart
