utils: Fix up 14a533680245
[samba4-gss.git] / source3 / script / smbaddshare
blob704c9f496453f0c274d519430688f4064772fef9
1 #!/bin/sh
3 # smbaddshare
5 # Copyright (C) 2015 Christof Schmitt
7 # Example script that can be used with the 'add share command' config
8 # option. This is mainly intended for use in the Samba selftest suite,
9 # please review and adapt it before using elsewhere.
12 CONF="$1"
13 SHARENAME="$2"
14 SHAREPATH="$3"
15 COMMENT="$4"
16 MAX_CONN="$5"
18 NETCONF="$BINDIR/net --configfile=$CONF conf"
20 $NETCONF addshare "$SHARENAME" "$SHAREPATH" writeable=no guest_ok=no "$COMMENT"
21 RC=$?
22 if [ $RC -ne 0 ]; then
23 echo Failure during addshare: rc=$RC
24 exit $RC
27 $NETCONF setparm "$SHARENAME" 'max connections' "$MAX_CONN"
28 RC=$?
29 if [ $RC -ne 0 ]; then
30 echo Failure during setparm for max connections: rc=$RC
31 exit $RC