File: stop_bind.cgi

package info (click to toggle)
webmin-virtual-server 2.50-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,608 kB
  • ctags: 392
  • sloc: perl: 15,687; makefile: 95; sh: 8
file content (25 lines) | stat: -rwxr-xr-x 525 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/local/bin/perl
# stop_bind.cgi
# Stop bind 8

require './virtual-server-lib.pl';
$access{'stop'} || &error($text{'stop_ecannot'});
&require_bind();
&error_setup($text{'bstop_err'});
if ($bconfig{'stop_cmd'}) {
	# Just use a command
	$out = &backquote_logged("( $bconfig{'stop_cmd'} ) 2>&1");
	if ($?) {
		&error("<pre>$out</pre>");
		}
	}
else {
	# Kill the process
	$pid = &get_bind_pid();
	if (!$pid || !&kill_logged('TERM', $pid)) {
		&error($text{'bstop_epid'});
		}
	}
&webmin_log("stop", "dns");
&redirect("");