当前时区 GMT+8, 现在时间是 2008-9-7 18:26 游客: 注册 登录 仅登录论坛 | 搜索 帮助
标题: 新手求教关于cgi问题
black0ice
新手上路
Rank: 1


UID 20882
精华 0
积分 20
帖子 8
阅读权限 10
注册 2003-3-10
来自 China.gif
状态 离线
发表于 2007-3-19 21:23  资料  短消息  加为好友 
新手求教关于cgi问题

我是cgi+shell初学者,想学一些通过页面运行自己的shell脚本,但是发现自己编写的脚本无法通过页面调用,但在系统内部可以正常执行。请教各位大虾给个帮助。脚本如下:
-------------------------------------
#!/bin/sh
echo Content-type: text/plain

`route add -net 192.168.2.0/24 gw 202.161.130.1`

echo ""

echo `route -n`
--------------------------------------
保存为chroute
#chmod 755 chroute
在系统上运行sh chroute正常,通过浏览器运行 http://202.161.130.25/cgi-bin/chroute,
在web页面上显示了路由信息,但是没有看到新增的
路由。即通过页面运行脚本后,route add好像没有生效,
但是 route -n 可以打印出路由信息。
请教各位如何通过cgi运行自己编写的shell来添加路由

顶部
 


Powered by Discuz! 5.5.0  © 2001-2007 Comsenz Inc.
清除 Cookies - 联系我们 - 中国Linux公社 - WAP