#! /usr/local/bin/perl
#
# Copyright (c) 1992 The Ohio State University.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that: (1) source distributions retain this entire copyright
# notice and comment, and (2) distributions including binaries display
# the following acknowledgement:  ``This product includes software
# developed by The Ohio State University and its contributors''
# in the documentation or other materials provided with the distribution
# and in all advertising materials mentioning features or use of this
# software. Neither the name of the University nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#

require 'global.defs';
require 'local.defs';
require $backuplib_perl;

if ($hostname eq $db_server) {
    $db_parent = &parent($db_local);

    &make_directory($db_parent) if (! -d $db_parent);

    if (! -d $db_local) {
        system("$ln_prog -s $db_remote $db_local");
    }
} else {
    &make_directory($db_local) if (! -d $db_local);

    system("$mount_prog $db_server:$db_remote $db_local");
}

sub unmount_stuff {
    if ($hostname ne $db_server) {
	system("$umount_prog $db_local");
    }
}

