#!/bin/sh # config export CIFSMNT_PATH=/usr/sbin share=$2 mountpoint=$3 umountpoint=$2 username=$4 password=$5 unmount() { echo "unmount cifs $umountpoint..." umount $umountpoint 2>/dev/null rmdir $umountpoint 2>/dev/null rmmod cifs 2>/dev/null } mount() { echo "mount cifs $mountpoint..." modprobe cifs 2>/dev/null mkdir $mountpoint $CIFSMNT_PATH/mount.cifs $share $mountpoint -o user=$username,pass=$password } case "$1" in mount) mount ;; umount) unmount ;; *) echo "usage:" echo "$0 mount " echo "$0 umount " ;; esac