summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-11 11:18:48 +1100
committerAndrew Tridgell <tridge@samba.org>2010-11-11 02:57:04 +0000
commit60cb372bd6c874af1050ff3d723bacee8c9cbf8e (patch)
tree0f562cf98a36cf7ab3da9591e65903c7676db395
parente908c263916c1e18468054d8a0416e5a1425c25d (diff)
downloadsamba-60cb372bd6c874af1050ff3d723bacee8c9cbf8e.tar.gz
samba-60cb372bd6c874af1050ff3d723bacee8c9cbf8e.tar.bz2
samba-60cb372bd6c874af1050ff3d723bacee8c9cbf8e.zip
s4-devel: useful script for testing join with empty smb.conf
this sets up all the needed --options for a join with a prefix other than the one compiled in
-rwxr-xr-xsource4/scripting/devel/config_base43
1 files changed, 43 insertions, 0 deletions
diff --git a/source4/scripting/devel/config_base b/source4/scripting/devel/config_base
new file mode 100755
index 0000000000..253606582d
--- /dev/null
+++ b/source4/scripting/devel/config_base
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+
+# this is useful for running samba tools with a different prefix
+
+# for example:
+# samba-tool $(scripting/devel/config_base /tmp/testprefix) join .....
+
+import sys, os
+
+vars = {
+ "dns update command" : "${PREFIX}/bin/samba_dnsupdate",
+ "spn update command" : "${PREFIX}/bin/samba_spnupdate",
+ "ncalrpc dir" : "${PREFIX}/var/ncalrpc",
+ "private dir" : "${PREFIX}/private",
+ "lock dir" : "${PREFIX}/var/locks",
+ "pid directory" : "${PREFIX}/var/run",
+ "winbindd socket directory" : "${PREFIX}/var/run/winbindd",
+ "winbindd privileged socket directory" : "${PREFIX}/var/lib/winbindd_privileged",
+ "ntp signd socket directory" : "${PREFIX}/var/run/ntp_signd"
+}
+
+if len(sys.argv) != 2:
+ print("Usage: config_base BASEDIRECTORY")
+ sys.exit(1)
+
+prefix = sys.argv[1]
+
+config_dir = prefix + "/etc"
+config_file = config_dir + "/smb.conf"
+
+if not os.path.isdir(config_dir):
+ os.makedirs(config_dir, mode=0755)
+if not os.path.isfile(config_file):
+ open(config_file, mode='w').close()
+
+options = " --configfile=${PREFIX}/etc/smb.conf"
+
+for v in vars:
+ options += " --option=%s=%s" % (v.replace(" ",""), vars[v])
+
+options = options.replace("${PREFIX}", prefix)
+
+print options