Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 - 1
#!/bin/bash
2
 
3
# This file must be executable to work! chmod 755!
4
 
5
key="$1"
6
opts="-fstype=cifs"
7
 
8
for P in /bin /sbin /usr/bin /usr/sbin
9
do
10
	if [ -x $P/smbclient ]
11
	then
12
		SMBCLIENT=$P/smbclient
13
		break
14
	fi
15
done
16
 
17
[ -x $SMBCLIENT ] || exit 1
18
 
19
$SMBCLIENT -gNL $key 2>/dev/null| awk -v key="$key" -v opts="$opts" -F'|' -- '
20
	BEGIN	{ ORS=""; first=1 }
21
	/Disk/	{
22
		  if (first)
23
			print opts; first=0
24
		  dir = $2
25
		  loc = $2
26
		  # Enclose mount dir and location in quotes
27
		  # Double quote "$" in location as it is special
28
		  gsub(/\$$/, "\\$", loc);
29
		  gsub(/\&/,"\\\\&",loc)
30
		  print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\""
31
		}
32
	END 	{ if (!first) print "\n"; else exit 1 }
33
	'
34