TMP: add a ctdb snapshot of current ctdb master (git://git.samba.org/ctdb.git) to...
[obnox/samba/samba-obnox.git] / ctdb / tests / eventscripts / stubs / testparm
1 #!/bin/sh
2
3 # Ensure that testparm always uses our canned configuration instead of
4 # the global one, unless some other file is specified.  This requires
5 # testparm to be installed but is quicker than reimplementing all the
6 # various command-line options.
7
8 file_specified=false
9 for i ; do
10     case "$i" in
11         -*) : ;;
12         *) file_specified=true
13     esac
14 done
15
16 if $file_specified ; then
17     # This should include the shares, since this is used when the
18     # samba eventscript caches the output.
19     /usr/bin/testparm "$@"
20 else
21     # We force our own smb.conf and add the shares.
22     /usr/bin/testparm "$@" "${CTDB_ETCDIR}/samba/smb.conf"
23
24     for i in $FAKE_SHARES ; do
25         bi=$(basename "$i")
26 cat <<EOF
27
28 [${bi}]
29         path            = $i
30         comment         = fake share $bi
31         guest ok        = no
32         read only       = no
33         browseable      = yes
34 EOF
35     done
36 fi