LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 740|回复: 8

LFS6.1环境下,这个脚本错在哪里?

[复制链接]
发表于 2006-6-28 20:19:24 | 显示全部楼层 |阅读模式
#!/bin/sh
# Begin $rc_base/init.d/test

. /etc/sysconfig/rc
. $rc_functions

case "$1" in
start)
boot_mesg "Starting test..."
/sbin/ifconfig eth0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255
;;

stop)
boot_mesg "Stopping test..."
/sbin/ifconfig eth0 192.168.0.250 netmask 255.255.255.0 broadcast 192.168.0.255

;;

*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac

# End $rc_base/init.d/test
-----------------------------------------------------------
报:bad interpreter :NO such file of directory

#/sbin/ifconfig eth0 正常
发表于 2006-6-28 20:23:09 | 显示全部楼层
怎样激活?
回复 支持 反对

使用道具 举报

发表于 2006-6-28 20:23:12 | 显示全部楼层
. $rc_functions
这个是什么?好象没定义呀.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-6-28 20:25:23 | 显示全部楼层
Post by d00m3d
怎样激活?

/etc/rc.d/init.d/test start
报如上错误。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-6-28 20:27:08 | 显示全部楼层
test
放在 /etc/rc.d/init.d/下
回复 支持 反对

使用道具 举报

发表于 2006-6-28 20:37:44 | 显示全部楼层
/bin/sh 存在么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-6-28 21:31:43 | 显示全部楼层
Post by 终极幻想
/bin/sh 存在么?

/bin/sh 存在。
回复 支持 反对

使用道具 举报

发表于 2006-6-28 22:25:13 | 显示全部楼层
能运行么。。。。呵呵。
回复 支持 反对

使用道具 举报

发表于 2006-6-30 10:16:26 | 显示全部楼层
嘿嘿,在我这运行正常啊,可能是楼主人品有问题吧:%
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表