Arpith Chacko Jacob - since 1982...

  Mounting windows shares from Linux

Saturday 24th 2004f July 2004, 09:42:50 am. Posted in: Geek. 130 words.  

Here's a quick shell script I wrote to mount windows shares from Linux. It may be called with the arguments 'mount' or 'umount' to respectively mount and unmount the windows shares.

#!/bin/sh

if [ $# -le "0" ]; then
   echo "Usage: mwfs [mount | umount]"
   exit 0
fi

case "$1" in
   [mM][oO][uU][nN][tT] ) echo "Mounting wfs..."
        echo "Please enter password for acmeuser"
        stty -echo
        read PASS
        stty echo
        echo "Mounting //acme/users..."
        smbmount //acme/users /home/acmeuser/wfs/users -o username=acmeuser,workgroup=acmeindia,password=$PASS

   ;;
   [uU][mM][oO][uU][nN][tT] ) echo "Unmounting wfs..."
        echo "Unmounting //acme/users..."
        umount /home/acmeuser/wfs/users/

   ;;

   * )
   echo "Invalid parameter"
esac

exit 0

Comments:

No Comments for this post yet...



Post a comment:

Name:

Email:

Your email address will not be displayed on this site.
Site/Url:

Comment text:

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, a, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
URLs, email, AIM and ICQs will be converted automatically.

Options:

Auto-BR
Remember me (Set cookies for name, email & url)