-
Wrapper for smbclient and smbmount
In our LAN are some computers running Windows with a firewall which blocks port 445. So the programs smbclient and smbmount are waiting for a long time for aan answer at this port which never arrive. To overcome this I have written two wrapper scripts which work very well (for me):
smbclient:
-- begin
#!/bin/sh
/usr/bin/smbclient "$@" -k -p 139
-- end
smbmount:
--begin
#!/bin/sh
SMBPAR=""
OPTPAR=0
OPTCNT=0
for PAR in $@; do
if [ $OPTPAR -eq 0 ]; then
SMBPAR="$SMBPAR $PAR"
else
for (( I=1; I<10; I=I+1 )); do
SUBPAR=`echo $PAR | cut -d ',' -f $I`
if [ "$SUBPAR" == "" ]; then
break
fi
NAME=`echo $SUBPAR | cut -d '=' -f 1`
if [ "$NAME" != "workgroup" ] && [ "$NAME" != "ip" ] && [ "$NAME" != "krb" ]; then
if [ $OPTCNT -gt 0 ]; then
SMBPAR="$SMBPAR,$SUBPAR"
else
SMBPAR="$SMBPAR $SUBPAR"
OPTCNT=1
fi
fi
done
fi
if [ "$PAR" == "-o" ]; then
OPTPAR=1
fi
done
if [ $OPTPAR -eq 0 ]; then
SMBPAR="$SMBPAR -o port=139"
else
if [ $OPTCNT -eq 0 ]; then
SMBPAR="$SMBPAR port=139"
else
SMBPAR="$SMBPAR,port=139"
fi
fi
/usr/bin/smbmount $SMBPAR,sockopt="SO_SNDBUF=8192,SO_RCVBUF=8192,gue st"
-- end
Just create two file smbclient and smbmount in /usr/local/bin and make them executable. You can still use the original programs. You just have to specify the full path.
By the way a very good program for viewing Windows and samba shares is smb4k. Would be nice to have it on a Knoppix CD.
Similar Threads
-
By daneel101 in forum Klik
Replies: 6
Last Post: 12-12-2004, 09:15 PM
-
By thedaz in forum Networking
Replies: 1
Last Post: 02-17-2004, 10:39 PM
-
By GdB in forum Networking
Replies: 2
Last Post: 02-10-2004, 01:41 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
HP ProLiant DL380 Gen9 8SFF Server - E5-2698 v3 - 32Cores - 128GB Ram - 1TB HDD
$299.00
1U Supermicro Server 10 Bay 2x Intel Xeon 3.3Ghz 8C 128GB RAM 480GB SSD 2x 10GBE
$273.00
Dell R730xd 26 Port SFF 2x E5-2697v4 36-Cores H730 128GB Server 2x SFP 10G ENT
$490.00
HP ProLiant DL380 Gen9 Server 1x Xeon E5-2620V3 2.40 GHz 16 GB RAM No OS No HDD
$114.95
Dell PowerEdge R620 Dual Intel Xeon E5-2697 v2 @2.70GHz 128GB RAM No HDD S110
$144.50
Dell R630 Server 2x E5-2620 V4 2.1GHz =16 Cores 128GB DDR4 1x 960GB 2x 1G 2x 10G
$345.00
DELL R440 8-Bay Server with 2x Bronze 3104 CPU, 2x PSU H330 Raid | No Ram, HD
$359.00
Dell PowerEdge R720 Dual Intel Xeon E5-2620 @2.00GHz 64GB RAM No HDD H710
$114.50
2U 12 Bay SAS3 SuperMicro Server 6028U-TR4T+ W/ X10DRU-i+ Barebone 12 Caddy RAIL
$299.00
Lenovo ThinkSystem ST50 V2 Tower Server Intel Xeon E-2324G 3.10 GHz 16 GB RAM
$774.99