#!/bin/ksh ################################################################################ # # File: mountlvm # Description: This script will mount a project's logical volumes # Author: Andrew DeFaria (defaria@cup.hp.com) # Language: Korn Shell # Modifications: # # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved # ################################################################################ me=$(basename $0) if [ $(id -u) -ne 0 ]; then print -u2 "$me: Error: You must be root to execute this command!" exit 1 fi if [ $# -ne 2 ]; then print -u2 "Usage: $me projectID fileserver" exit 1 fi projectID=$1 fileserver=$2 function create_dir_and_mount { machine=$1 mount_directory=$2 mount_over_directory=/tmp_mnt/net/$machine$2 if [ ! -d $mount_over_directory ]; then print Making $mount_over_directory mkdir -p $mount_over_directory fi if [ ! -d $mount_over_directory/lost+found ]; then print Mounting $machine:$mount_directory to $mount_over_directory /usr/sbin/mount $machine:$mount_directory $mount_over_directory fi } # create_dir_and_mount function kick_automounter { automount_pid=$(/app/sj automount | awk '{print $2}') print Kicking automounter \($automount_pid\) kill -HUP $automount_pid } # kick_automounter create_dir_and_mount cllvu01 /CLO/Storage/Views/$projectID create_dir_and_mount cllvu02 /CLO/Storage/Views/$projectID create_dir_and_mount cllvu03 /CLO/Storage/Views/$projectID create_dir_and_mount $fileserver /data/proj/$projectID kick_automounter