Permalink
Browse files

[6.1.10beta] - add '--help' argument also for fixdns

  • Loading branch information...
1 parent 0ff824f commit 083c3bd9a60eba4c41cb450ef5813bbc6f012b99 mustafaramadhan committed Nov 23, 2011
Showing with 27 additions and 1 deletion.
  1. +8 −0 kloxo/bin/fix/fixdns.php
  2. +19 −1 kloxo/pscript/fixdns
View
@@ -5,6 +5,9 @@
$list = parse_opt($argv);
+if (isset($list['server'])) { $server = $list['server']; }
+else { $server = 'localhost'; }
+
log_cleanup("Fixing DNS server config");
if (isset($list['new_dnstemplate'])) {
@@ -21,9 +24,14 @@
foreach($list as $c) {
$dlist = $c->getList('domaina');
+
foreach($dlist as $l) {
$dns = $l->getObject('dns');
+ if ($server !== 'all') {
+ if ($dns->syncserver !== $server) { continue; }
+ }
+
if ($dnst) {
$dns->dns_record_a = null;
$dns->copyObject($dnst);
View
@@ -1,3 +1,21 @@
#!/bin/sh
+
+if [ "$1" == "--help" ] ; then
+ echo
+ echo " ------------------------------------------------------------------------"
+ echo " format: sh $0 --server=<localhost/slaveid/all>"
+ echo " ------------------------------------------------------------------------"
+ echo " localhost = master (default)"
+ echo " slaveid = slave id (ip or hostname)"
+ echo " all = all servers (master and slave)"
+ echo
+ exit;
+fi
+
+echo
+echo "- For help, type '$0 --help'"
+echo "- No argument supplied. Defaulting to localhost (master) servers"
+echo
+
. /script/directory
-lphp.exe ../bin/fix/fixdns.php
+lphp.exe ../bin/fix/fixdns.php $*

0 comments on commit 083c3bd

Please sign in to comment.