1#!/bin/bash
2#
3#  This script uses the named D-BUS support, which must be enabled in
4#  the running named with the named '-D' option, to get and print the
5#  list of forwarding zones in the running server.
6# 
7#  It accepts an optional <zone> first argument which is the DNS name 
8#  of the zone whose forwarders (if any) will be retrieved.
9#
10#  If no zone argument is specified, all forwarding zones will be listed.
11#
12#  Usage: GetForwarders [ <zone> ] 
13# 
14#  Copyright(C) Jason Vas Dias<jvdias@redhat.com> Red Hat Inc. 2005
15#
16#  This program is free software; you can redistribute it and/or modify
17#  it under the terms of the GNU General Public License as published by
18#  the Free Software Foundation at 
19#           http://www.fsf.org/licensing/licenses/gpl.txt
20#  and included in this software distribution as the "LICENSE" file.
21#
22#  This program is distributed in the hope that it will be useful,
23#  but WITHOUT ANY WARRANTY; without even the implied warranty of
24#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25#  GNU General Public License for more details.
26#
27zone=''
28if [ $# -gt 0 ]; then 
29   zone="string:$1";
30fi
31dbus-send --system --type=method_call --print-reply --reply-timeout=20000 --dest=com.redhat.named /com/redhat/named com.redhat.named.text.GetForwarders $zone;
32