summaryrefslogtreecommitdiffstats
path: root/packaging/Mandrake/mount.smb
blob: ba3cee84e0af47df77cda1b5f7f99c499cd2a830 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#
# by Bill Nottingham <notting@redhat.com>
#
# Adapted from mount.smb by Greg Galperin, MAR99 <grg@ai.mit.edu>
#

if [ $# != 4 -o "$3" != "-o" ]; then
	echo "unsupported commandline $0 $*"
	exit -1
fi

for arg in `echo $4 | tr ',' ' '`; do
        case "$arg" in
	  user=*)
	      SMBUSER="`echo $arg | cut -d '=' -f 2-`"
	      ;;
          passwd=*)
              PASSWD=`echo $arg | cut -d '=' -f 2-`
              ;;
	  domain=*)
	      DOMAIN="-W `echo $arg | cut -d '=' -f 2-`"
	      ;;
	   *)
	     ;;
	esac
done

if [ -n "$PASSWD" ]; then
      USER=$SMBUSER%$PASSWD exec smbmount "$1" $2 $DOMAIN
else
      USER=$SMBUSER exec smbmount "$1" $2 $DOMAIN -N
fi
exit $?