- 论坛徽章:
- 0
|
我想通过web来管理服务器 但不知道为何perl脚本在web上运行后没任何反映
#!/usr/bin/perl -w
use CGI;
my $cgi = new CGI;
$id = $cgi -> param('id');
print "content-type:text/plain\n\n\n";
print "hello \n";
$sys = $id;
&restart_vsftpd if($sys==1);
&restart_php if($sys==2);
&restart_nginx if($sys==3);
&restart_server if($sys==4);
sub restart_php {
unless (system "/web/cgi/admin/c/cgi/php.sh &"){
print "We gave a date, OK!\n";
}
}
sub restart_vsftpd {
system "/web/cgi/admin/c/cgi/vsftpd.sh";
}
sub restart_nginx {
system "/web/cgi/admin/c/cgi/nginx.sh";
}
sub restart_server {
system "/web/cgi/admin/c/cgi/reboot.sh";
}
|
sh脚本是
/usr/local/etc/rc.d/*** restart
好像是权限的问题 但不知道如何解决 |
|