#!/bin/sh

APN_DB=/usr/local/share/mobifd/apn.db.gz
APN_DB_UNCOMPRESSED=/tmp/apn.db

uncompress_apn_db(){
	# check if apn db is already uncompressed
	[ -f "/tmp/apn.db" ] && return

	# Uncompress APN database
	[ -f "$APN_DB" ] && gzip -dkc "$APN_DB" > "$APN_DB_UNCOMPRESSED" && perm "$APN_DB_UNCOMPRESSED" > /dev/null
}

conf_register_init_hook uncompress_apn_db