summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/eventscripts/bin/testparm
blob: 83aa5786734698e5ebade38098bf7551b8d7fc39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

# Ensure that testparm always uses our canned configuration instead of
# the global one, unless some other file is specified.  This requires
# testparm to be installed but is quicker than reimplementing all the
# various command-line options.

file_specified=false
for i ; do
    case "$i" in
	-*) : ;;
	*) file_specified=true
    esac
done

if $file_specified ; then
    # This should include the shares, since this is used when the
    # samba eventscript caches the output.
    /usr/bin/testparm "$@"
else
    # We force our own smb.conf and add the shares.
    /usr/bin/testparm "$@" "${CTDB_ETCDIR}/samba/smb.conf"

    for i in $FAKE_SHARES ; do
	bi=$(basename "$i")
cat <<EOF

[${bi}]
	path		= $i
	comment		= fake share $bi
	guest ok  	= no
	read only	= no
	browseable	= yes
EOF
    done
fi