File: change_rl.cgi

package info (click to toggle)
webmin 1.180-3sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 16,900 kB
  • ctags: 2,152
  • sloc: perl: 55,792; java: 1,362; sh: 980; ansic: 221; makefile: 191
file content (17 lines) | stat: -rwxr-xr-x 475 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/local/bin/perl
# change_rl.cgi
# Switch to a different runlevel with the telinit command

require './init-lib.pl';
&ReadParse();
%access = &get_module_acl();
$access{'bootup'} == 1 || &error($text{'change_ecannot'});

&ui_print_header(undef, $text{'change_title'}, "");

$cmd = "telinit '$in{'level'}'";
print "<p>",&text('change_cmd', $in{'level'}, "<tt>$cmd</tt>"),"<p>\n";
system("$cmd </dev/null >/dev/null 2>&1 &");

&ui_print_footer("", $text{'index_return'});