xref: /freebsd/contrib/smbfs/examples/smbfs.sh.sample (revision ae83180158c4c937f170e31eff311b18c0286a93)
1#!/bin/sh
2#
3# $Id: smbfs.sh.sample,v 1.3 2001/01/13 04:50:36 bp Exp $
4#
5# Location: /usr/local/etc/rc.d/smbfs.sh
6#
7# Simple script to mount smbfs file systems at startup.
8# It assumes that all mount points described in fstab file and password
9# entries listed in /root/.nsmbrc file. See mount_smbfs(8) for details.
10#
11
12mount="/sbin/mount -o -N"
13umount=/sbin/umount
14HOME=/root; export HOME
15vols=`awk -- '/^\/.*[[:space:]]+smbfs[[:space:]]+/ { print $2 }' /etc/fstab`
16
17case "$1" in
18start)
19	echo -n "smbfs: "
20	for vol in ${vols}; do
21		$mount $vol
22		echo -n "$vol "
23	done
24	;;
25stop)
26	echo -n "unmounting smbfs mount points: "
27	for vol in ${vols}; do
28		$umount $vol
29		echo -n "$vol "
30	done
31	;;
32*)
33	echo "Usage: `basename $0` {start|stop}" >&2
34	exit 64
35esac
36
37echo "Done"
38