|
我建一个脚本,叫 rc.pureftpd 放在 /etc/rc.d 下,(系统为:slackware linux)
然后在 rc.M 中加入:
if [ -x /etc/rc.d/rc.pureftpd ]; then
. /etc/rc.d/rc.pureftpd start
fi
执行#chmod u+x rc.pureftpd
然后reboot,但出现了如下错误!
'etc/rc.d/rc.M: /etc/rc.d/rc.pureftpd: line 4:syntax error near unexpected token'{
'etc/rc.d/rc.M: /etc/rc.d/rc.pureftpd: line 4:'pureftpd_start(){
这究竟是什么原故呢?
[rc.pureftpd清单:]
#!/bin/sh
# Start/stop/restart pureftpd server.
# Start pureftpd:
pureftpd_start() {
if [ -x /usr/local/pureftpd/bin/pure-config.pl ]; then
/usr/local/pureftpd/bin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf
fi
}
# Stop pureftpd:
pureftpd_stop() {
killall pure-ftpd
}
# Restart pureftpd:
pureftpd_restart() {
pureftpd_stop
pureftpd_start
}
case "$1" in
'start')
pureftpd_start
;;
'stop')
pureftpd_stop
;;
'restart')
pureftpd_restart
;;
*)
echo "usage $0 start|stop|restart"
esac |
|