#!/bin/sh
. /etc/init.d/functions

split_dir()
{
    local host="$(/etc/init.d/nfsroot_hostname)"
    [ -n "$host" ] || return 0
    [ -d "$1-$host" ] || cp -a "$1-template" "$1-$host"
    ln -snf "$1-$host" "/redir/$1"
}

mount -n -o remount,rw /
mount "/redir"
split_dir /var
