-
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
NEW Palmrest Keyboard For Lenovo Thinkpad E15 Gen 2 20T8 20T9 Black 5M10W64513
$80.99
Lenovo 500w Gen 3 Laptop, 11.6" IPS Glass, N6000, 8GB, 128GB SSD, Win 11 Home
$186.99
Lenovo IP 5 16IAU7 16" 2.5K Chromebook i3-1215U 8GB Ram 128GB eMMC Chrome OS
$219.99
Lenovo Notebook IdeaPad 1 Laptop, N6000, 4GB, 128GB eMMC, Win 11 Home-Certified
$229.49
Lenovo Ideapad 1i 15.6" FHD Notebook Intel Core i5-1235U 8GB RAM 256GB SSD
$349.99
Lenovo ThinkPad Yoga 11e 11.6" 2in1 Touch Intel Core i3 4GB RAM 128GB SSD Win10
$59.00
Lenovo K14 AMD Laptop, 14" FHD IPS LED , Ryzen 5 5600U, GB, 256GB SSD
$569.00
Lenovo Flex 7 14IRU8 14" 2.2K Touch Intel Core i7-1355U 16GB 1TB SSD W11H
$539.99