| Server IP : 104.21.25.180 / Your IP : 162.159.115.41 Web Server : Apache/2.4.37 System : Linux almalinux.duckdns.org 4.18.0-553.111.1.el8_10.x86_64 #1 SMP Sun Mar 8 20:06:07 EDT 2026 x86_64 User : ricodeal ( 1046) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/libexec/webmin/virtual-server/ |
Upload File : |
#!/usr/bin/perl
# Stop and re-start the Rails server process behind some script
require './virtual-server-lib.pl';
&ReadParse();
$d = &get_domain($in{'dom'});
&can_edit_domain($d) && &can_edit_scripts() || &error($text{'edit_ecannot'});
# Get the script being started
@got = &list_domain_scripts($d);
($sinfo) = grep { $_->{'id'} eq $in{'script'} } @got;
$script = &get_script($sinfo->{'name'});
$sinfo && $script || &error($text{'stopscript_egone'});
# Do it and tell the user
&ui_print_header(&domain_in($d), $text{'scripts_urestart'}, "");
print &text('stopscript_doing', "<i>$script->{'desc'}</i>"),"<br>";
&{$script->{'stop_server_func'}}($d, $sinfo->{'opts'});
sleep(1); # Give it time to shut down
&$second_print($text{'setup_done'});
print &text('startscript_doing', "<i>$script->{'desc'}</i>"),"<br>";
$err = &{$script->{'start_server_func'}}($d, $sinfo->{'opts'});
if ($err) {
&$second_print(&text('startscript_failed', $err));
}
else {
&$second_print($text{'setup_done'});
}
&run_post_actions();
if (!$err) {
&webmin_log("restart", "script", $sinfo->{'name'},
{ 'ver' => $sinfo->{'version'},
'desc' => $sinfo->{'desc'},
'dom' => $d->{'dom'} });
}
&ui_print_footer("edit_script.cgi?dom=$in{'dom'}&script=$in{'script'}",
$text{'scripts_ereturn'},
"list_scripts.cgi?dom=$in{'dom'}", $text{'scripts_return'},
&domain_footer_link($d));