-
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) AMD Ryzen 7 5700X 8 Core 16 Thread AM4 Unlocked 3.4 GHz CPU OEM Tray
$174.99

HP Z420 Pro Workstation PC Xeon E5-2660 8-Core 64GB RAM Quadro K5000 128GB SSD
$249.00

Intel Core i7-10700 8-Core 16-Thread 2.9GHz Desktop CPU LGA1200 SRH6Y Z490 Z590
$129.00

SGIN 17.3" Laptop Intel Quad-Core Up to 2.4 GHZ 8GB RAM 256GB SSD HD
$229.99

Intel Xeon E5 - 2667V2 / SR19W 3.30GHz 25MB 8-Core CPU Socket LGA2011
$30.00

AMD Ryzen 7 9700X 8-Core 16-Thread 40MB Cache Socket AM5 9000 Series Processor
$245.99

AMD Ryzen Threadripper PRO 3945WX 12-Core 4.0GHz sWRX8 CPU NEW Tray Unlocked
$79.99

AMD FX 8350 8-CORE 4.00GHz CPU FD8350FRW8KHK SOCKET AM3+ *QTY
$39.99

Intel Core i7-11700KF 3.60GHz 8 Core SRKNN 16 Thread LGA 1200 USED
$180.00

Dell Optiplex 7050 Micro Core i5-7500 8 GB RAM 256GB SSD Microsoft Windows 11
$89.99