ctdb-scripts: Don't set arp_filter=1 by default in 10.interface
[samba4-gss.git] / source4 / scripting / devel / config_base
blobf593f2f627d6de64d215dcb60087d41b95bd87d7
1 #!/usr/bin/env python3
3 # this is useful for running samba tools with a different prefix
5 # for example:
6 # samba-tool $(scripting/devel/config_base /tmp/testprefix) join .....
8 import sys, os
10 vars = {
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     "ntp signd socket directory" : "${PREFIX}/var/run/ntp_signd"
19 if len(sys.argv) != 2:
20     print("Usage: config_base BASEDIRECTORY")
21     sys.exit(1)
23 prefix = sys.argv[1]
25 config_dir  = prefix + "/etc"
26 config_file = config_dir + "/smb.conf"
28 if not os.path.isdir(config_dir):
29     os.makedirs(config_dir, mode=0o755)
30 if not os.path.isfile(config_file):
31     open(config_file, mode='w').close()
33 options = (
34           " --configfile=${PREFIX}/etc/smb.conf"
35           "".join(" --option=%s=%s" % (v.replace(" ",""), vars[v]) for v in vars)
36           ).replace("${PREFIX}", prefix)
39 print(options)