免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1712 | 回复: 0
打印 上一主题 下一主题

[求助]在php页面使用super插件,调用ifconfig 命令的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-05-20 08:10 |只看该作者 |倒序浏览
部分代码如下:
<form action=./ifconfig.php method=post>
   ip:<input type=text name="ip">
   netmask:<input type=text name="netmask">
   username:<input type=text name="username">
<input type=submit value="apply">
</form>
<?
$ip = trim($_POST["ip"]);
$netmask =trim($_POST["netmask"]);
$username =trim($_POST["username"]);
$eth = "eth0";
$nm  = "netmask";
echo "ifconfig $eth $ip $nm $netmask";
echo "<br>";
system(escapeshellcmd("/bin/super superif".$eth .$ip .$nm .$netmask));
//system("ifconfig");
echo "</br>";
system("/bin/super auser $username");
system("/bin/super superif");
?>

环境说明:rh企业4,super插件。

super插件运行正常,因为可以在此页面添加用户。

以下是super插件的配置文件:

superif  /sbin/ifconfig  apache
auser /usr/bin/useradd apache

但是system(escapeshellcmd("/bin/super superif".$eth .$ip .$nm .$netmask));

这句执行后没有效果,"/bin/super superif"的意思是启用super定义的ifconfig别名,我把eth0和netmask

当作参数并用.连接","ip和子网掩码也作为参数,是由用户从页面提交的。

不知道问题出在哪?估计是用英文句号链接变量的语法不对??大家帮帮忙!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP