sanny 发表于 2012-3-4 15:38:25

service sshd restart出现/etc/init.d/sshd: line 183: syntax error: unexpected end o

case "$1" in
      start)
                start
                ;;
      stop)
                stop
                ;;
      restart)
                stop
                start
                ;;
      reload)
                reload
                ;;
      condrestart)
                if [ -f /var/lock/subsys/sshd ] ; then
                        do_restart_sanity_check
                        if [ "$RETVAL" = 0 ] ; then
                              stop
                              # avoid race
                              sleep 3
                              start
                        fi
                fi
                ;;
      status)
                status -p $PID_FILE openssh-daemon
                RETVAL=$?
                ;;
      *)
                echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
                RETVAL=1
exit $RETVAL

183行就是最后一行,这什么问题呢。

licess 发表于 2012-3-4 16:48:05

case语句没结束吧
exit $RETVAL前面新加上一行esac

sanny 发表于 2012-3-4 22:07:09

谢谢,问题已解决:) :) :) :) :)
页: [1]
查看完整版本: service sshd restart出现/etc/init.d/sshd: line 183: syntax error: unexpected end o