3 # this is useful for running samba tools with a different prefix
6 # samba-tool $(scripting/devel/config_base /tmp/testprefix) join .....
11 "ncalrpc dir" : "${PREFIX}/var/ncalrpc",
12 "private dir" : "${PREFIX}/private",
13 "lock dir" : "${PREFIX}/var/locks",
14 "pid directory" : "${PREFIX}/var/run",
15 "winbindd socket directory" : "${PREFIX}/var/run/winbindd",
16 "winbindd privileged socket directory" : "${PREFIX}/var/lib/winbindd_privileged",
17 "ntp signd socket directory" : "${PREFIX}/var/run/ntp_signd"
20 if len(sys
.argv
) != 2:
21 print("Usage: config_base BASEDIRECTORY")
26 config_dir
= prefix
+ "/etc"
27 config_file
= config_dir
+ "/smb.conf"
29 if not os
.path
.isdir(config_dir
):
30 os
.makedirs(config_dir
, mode
=0755)
31 if not os
.path
.isfile(config_file
):
32 open(config_file
, mode
='w').close()
34 options
= " --configfile=${PREFIX}/etc/smb.conf"
37 options
+= " --option=%s=%s" % (v
.replace(" ",""), vars[v
])
39 options
= options
.replace("${PREFIX}", prefix
)