X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=clients%2FHP%2Fbin%2Fmount_nfs;fp=clients%2FHP%2Fbin%2Fmount_nfs;h=59766fbe229b5d6518df7e4a83de187288e3cb12;hb=a8c84d2892f07a6863b68a11eb0a4a79ffd71fb5;hp=0000000000000000000000000000000000000000;hpb=95384f94f88aceeb5eef2d322210ba4a438b6512;p=clearscm.git diff --git a/clients/HP/bin/mount_nfs b/clients/HP/bin/mount_nfs new file mode 100644 index 0000000..59766fb --- /dev/null +++ b/clients/HP/bin/mount_nfs @@ -0,0 +1,43 @@ +#!/bin/ksh +################################################################################ +# +# File: unmount_nfs +# RCS: $Header:$ +# Description: A script to unmount all nfs mounts. Note if the automounter is +# running then this script will first shutdown the automounter. +# This script returns 0 for success or non zero if it was unable +# to umount all nfs mounts. This script must run as root. +# Author: Andrew DeFaria, California Language Labs +# Created: Fri Jun 6 10:31:51 PDT 1997 +# Modified: +# Language: Korn Shell +# +# (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved +# +################################################################################ +export me=`basename $0` +export OS=$(/bin/uname -r | /usr/bin/cut -f2 -d.) + +if [ $(id -u) -ne 0 ]; then + print -u2 "$me: Error: You must be root to use this command" + exit 1 +fi + +# First try to mount any nfs mounts listed in /etc/checklist +print "Re-establishing all static NFS mounts..." +if [ "$OS" = "10" ]; then + /usr/sbin/mount -aQF nfs +else + /etc/mount -at nfs +fi + +# Restart automounter if necessary +if [ -f /etc/automounter_was_here ]; then + print "Restarting automounter..." + if [ "$OS" = "10" ]; then + /usr/sbin/automount -f /etc/auto_master + else + /usr/etc/automount -f /etc/auto_master + fi + rm -f /etc/automounter_was_here +fi