• 如何用chkconfig查看手动输入,跳出循环的四个命令


    如何自己加入脚本并可用chkconfig查看

    设置文件名为:case.sh

    #!/bin/bash
    #chkconfig:                35                  90 10

                             在三和五模式中开启

    . /etc/init.d/functions

    case $1 in
            start)
                    action "服务开始启动.." /bin/true
                    ;;
            stop)
                    action "服务准备停止.." /bin/false
                    ;;
            restart)
                    action "服务准备停止" /bin/true
                    action "服务开始启动" /bin/false
                    ;;
            *)
                    echo "请输入正确参数"
                    ;;
    esac

    将文件复制到/etc/init.d/下

    输入命令:chkconfig --add case.sh

                      chkconfig --list case.sh查看

    跳出循环

    exit  直接终止循环

    break  跳出最近的循环圈

    continue   终止本次循环,提前进入下次循环

    return    终止函数的循环,从调用开始循环的地方结束循环,直接跳出函数循环圈

  • 相关阅读:
    Redis
    Redis
    Redis
    linux 安装docker
    linux 安装nexus
    linux 安装jenkins
    linux 安装gitlab
    python 类的继承
    python raise & assert
    python super()
  • 原文地址:https://www.cnblogs.com/mashuang/p/9898223.html
Copyright © 2020-2023  润新知