1 #!/bin/sh /usr/share/dpatch/dpatch-run
2 ## 080_auto_smb_probe_credentials.dpatch
8 diff -Naur .B/samples/auto.smb .A/samples/auto.smb
9 --- .B/samples/auto.smb 2007-01-07 21:36:36.000000000 +0000
10 +++ .A/samples/auto.smb 2007-01-07 21:36:37.000000000 +0000
12 # This file must be executable to work! chmod 755!
16 +mountopts="-fstype=cifs"
18 +credfile="/etc/auto.smb.$key"
20 for P in /bin /sbin /usr/bin /usr/sbin
24 [ -x $SMBCLIENT ] || exit 1
26 -$SMBCLIENT -gNL $key 2>/dev/null| awk -v key="$key" -v opts="$opts" -F'|' -- '
27 +if [ -e $credfile ]; then
28 + mountopts="$mountopts,credentials=$credfile"
29 + smbopts="-A $credfile"
34 +$SMBCLIENT $smbopts -gL $key 2>/dev/null| awk -v key="$key" -v opts="$mountopts" -F'|' -- '
35 BEGIN { ORS=""; first=1 }
36 /Disk/ { if (first) { print opts; first=0 }; sub(/ /, "\\ ", $2); print " \\\n\t /" $2, "://" key "/" $2 }
37 END { if (!first) print "\n"; else exit 1 }