#!/bin/sh not_implemented() { echo "testparm: option \"$1\" not implemented in stub" >&2 exit 2 } error() { cat >&2 <&2 cat >&2 <&2 } if [ -n "$FAKE_TESTPARM_FAIL" ]; then error fi if [ -n "$FAKE_TIMEOUT" ]; then timeout fi # Ensure that testparm always uses our canned configuration instead of # the global one, unless some other file is specified. file="" param="" for i; do case "$i" in --parameter-name=*) param="${i#--parameter-name=}" ;; -*) : ;; *) file="$i" ;; esac done # Parse out parameter request if [ -n "$param" ]; then sed -n \ -e "s|^[[:space:]]*${param}[[:space:]]*=[[:space:]]\(..*\)|\1|p" \ "${file:-"${CTDB_SYS_ETCDIR}/samba/smb.conf"}" exit 0 fi if [ -n "$file" ]; then # This should include the shares, since this is used when the # samba eventscript caches the output. cat "$file" else # We force our own smb.conf and add the shares. cat "${CTDB_SYS_ETCDIR}/samba/smb.conf" for i in $FAKE_SHARES; do bi=$(basename "$i") cat <