• weblogic管理脚本


    start.sh 

    Java代码 
    1. #!/usr/bin/bash  
    2. #  
    3. # start.sh  
    4. # @auth: zhoulin@lianchuang.com  
    5. #  
    6.   
    7. SERVER_STATUS () {  
    8.     serv_status=`ps -ef | grep weblogic | grep webapp | grep -v grep | grep $1 | wc -l`  
    9.     if [ "$serv_status" -eq "1" ]; then  
    10.         echo "[status: Running]"  
    11.     else  
    12.         echo "[status: Stopped]"  
    13.     fi  
    14. }  
    15.   
    16. adminserver="http://10.168.31.108:7001"  
    17.   
    18. echo "================= NGBOSS WebLogic Server start console =================="  
    19. echo " a: start admin                 "     `SERVER_STATUS AdminServer`  
    20. echo " p: start proxy                 "     `SERVER_STATUS proxy`        
    21. echo " 1: start ngboss                "     `SERVER_STATUS ngboss`  
    22. echo " 2: start chnlmanm              "     `SERVER_STATUS copmanm`  
    23. echo " 3: start copmanm               "     `SERVER_STATUS copmanm`  
    24. echo " 4: start custmanm              "     `SERVER_STATUS custmanm`  
    25. echo " 5: start resmanm               "     `SERVER_STATUS resmanm`  
    26. echo " 6: start salemanm              "     `SERVER_STATUS salemanm`   
    27. echo " 7: start statmanm              "     `SERVER_STATUS statmanm`  
    28. echo " 8: start sysmanm               "     `SERVER_STATUS sysmanm`  
    29. echo " 9: start saleserv              "     `SERVER_STATUS saleserv`  
    30. echo " q: to quit"  
    31. echo "========================================================================="  
    32. echo -n "Please select which server you want to start: "  
    33. read v_server  
    34.   
    35. cd  
    36. cd ngadmindomain  
    37.   
    38. case $v_server in  
    39. "a")  
    40.     echo "starting admin server..."  
    41.     nohup bin/startWebLogic.sh &  
    42.     ;;  
    43. "p")  
    44.     echo "starting proxy server..."  
    45.     nohup bin/startManagedWebLogic.sh proxy $adminserver &  
    46.     ;;  
    47. "1")  
    48.     echo "starting ngboss server..."  
    49.     nohup bin/startManagedWebLogic.sh ngboss $adminserver &  
    50.     ;;  
    51. "2")  
    52.     echo "starting chnlmanm server..."  
    53.     nohup bin/startManagedWebLogic.sh chnlmanm $adminserver &  
    54.     ;;  
    55. "3")  
    56.     echo "starting copmanm server..."  
    57.     nohup bin/startManagedWebLogic.sh copmanm $adminserver &  
    58.     ;;  
    59. "4")  
    60.     echo "starting custmanm server..."  
    61.     nohup bin/startManagedWebLogic.sh custmanm $adminserver &  
    62.     ;;  
    63. "5")  
    64.     echo "starting resmanm server..."  
    65.     nohup bin/startManagedWebLogic.sh resmanm $adminserver &  
    66.     ;;  
    67. "6")  
    68.     echo "starting salemanm server..."  
    69.     nohup bin/startManagedWebLogic.sh salemanm $adminserver &  
    70.     ;;  
    71. "7")  
    72.     echo "starting statmanm server..."  
    73.     nohup bin/startManagedWebLogic.sh statmanm $adminserver &  
    74.     ;;  
    75. "8")  
    76.     echo "starting sysmanm server..."  
    77.     nohup bin/startManagedWebLogic.sh sysmanm $adminserver &  
    78.     ;;  
    79. "9")  
    80.     echo "starting saleserv server..."  
    81.     nohup bin/startManagedWebLogic.sh saleserv $adminserver &  
    82.     ;;  
    83. *)  
    84.     echo "you have not select any server to start yet!"  
    85.     ;;  
    86. esac  
    87.   
    88. exit 0  



    stop.sh 

    Java代码 
    1. #!/usr/bin/bash  
    2. #  
    3. # stop.sh  
    4. # @auth: zhoulin@lianchuang.com  
    5. #  
    6.   
    7. SERVER_STATUS () {  
    8.         serv_status=`ps -ef | grep weblogic | grep webapp | grep -v grep | grep $1 | wc -l`  
    9.         if [ "$serv_status" -eq "1" ]; then  
    10.                 echo "[status: Running]"  
    11.         else  
    12.                 echo "[status: Stopped]"  
    13.         fi  
    14. }  
    15.   
    16. echo "=============== NGBOSS WebLogic Server stop console =============="  
    17. echo " a:    stop admin                               " `SERVER_STATUS AdminServer`   
    18. echo " p:    stop proxy                               " `SERVER_STATUS proxy`  
    19. echo " 1:    stop ngboss                              " `SERVER_STATUS ngboss`  
    20. echo " 2:    stop chnlmanm                            " `SERVER_STATUS chnlmanm`  
    21. echo " 3:    stop copmanm                             " `SERVER_STATUS copmanm`  
    22. echo " 4:    stop custmanm                            " `SERVER_STATUS custmanm`  
    23. echo " 5:    stop resmanm                             " `SERVER_STATUS resmanm`  
    24. echo " 6:    stop salemanm                            " `SERVER_STATUS salemanm`  
    25. echo " 7:    stop statmanm                            " `SERVER_STATUS statmanm`  
    26. echo " 8:    stop sysmanm                             " `SERVER_STATUS sysmanm`  
    27. echo " 9:    stop saleserv                            " `SERVER_STATUS saleserv`  
    28. echo " 99:   stop all server except admin and proxy   "  
    29. echo " 100:  stop all"  
    30. echo " q:   to quit"  
    31. echo "================================================================="  
    32. echo -n "Please select which server you want to stop: "  
    33. read v_server  
    34.   
    35. case $v_server in  
    36. "a")  
    37.     echo "stopping admin server..."  
    38.     kill -9 `ps -ef | grep weblogic | grep -v grep | grep "AdminServer" | awk '{print $2}'`  
    39.     ;;  
    40. "p")  
    41.     echo "stopping proxy server..."  
    42.     kill -9 `ps -ef | grep weblogic | grep -v grep | grep "proxy" | awk '{print $2}'`  
    43.     ;;  
    44. "1")  
    45.     echo "stopping ngboss server..."  
    46.     kill -9 `ps -ef | grep weblogic | grep -v grep | grep "ngboss" | awk '{print $2}'`  
    47.     ;;  
    48. "2")  
    49.     echo "stopping chnlmanm server..."  
    50.     kill -9 `ps -ef | grep weblogic | grep -v grep | grep "chnlmanm" | awk '{print $2}'`  
    51.     ;;  
    52. "3")  
    53.     echo "stopping copmanm server..."  
    54.     kill -9 `ps -ef | grep weblogic | grep -v grep | grep "copmanm" | awk '{print $2}'`  
    55.     ;;  
    56. "4")  
    57.     echo "stopping custmanm server..."  
    58.     kill -9 `ps -ef | grep weblogic | grep -v grep | grep "custmanm" | awk '{print $2}'`  
    59.     ;;  
    60. "5")  
    61.     echo "stopping resmanm server..."  
    62.     kill -9 `ps -ef | grep weblogic | grep -v grep | grep "resmanm" | awk '{print $2}'`  
    63.     ;;  
    64. "6")  
    65.     echo "stopping salemanm server..."  
    66.     kill -9 `ps -ef | grep weblogic | grep -v grep | grep "salemanm" | awk '{print $2}'`  
    67.     ;;  
    68. "7")  
    69.     echo "stopping statmanm server..."  
    70.     kill -9 `ps -ef | grep weblogic | grep -v grep | grep "statmanm" | awk '{print $2}'`  
    71.     ;;  
    72. "8")  
    73.     echo "stopping sysmanm server..."  
    74.     kill -9 `ps -ef | grep weblogic | grep -v grep | grep "sysmanm" | awk '{print $2}'`   
    75.     ;;  
    76. "9")  
    77.     echo "stopping saleserv server..."  
    78.     kill -9 `ps -ef | grep weblogic | grep -v grep | grep "saleserv" | awk '{print $2}'`   
    79.     ;;  
    80. "99")  
    81.     echo "stopping all server except AdminServer..."  
    82.     kill -9 `ps -ef | grep weblogic | grep -v grep | grep -v "AdminServer" | grep -v "proxy" | awk '{print $2}'`  
    83.     ;;  
    84. "100")  
    85.     echo "stopping all servers..."  
    86.     kill -9 `ps -ef | grep weblogic | grep -v grep | awk '{print $2}'`  
    87.     ;;  
    88. *)  
    89.     echo "you have not select any server to stop yet!"  
    90.     ;;  
    91. esac  
    92.   
    93. exit 0  
  • 相关阅读:
    作用域链
    traceback
    mac安装sshpass
    awk
    bond
    sqlx
    svn
    JS对象合并方法
    echarts图形超出宽度限制范围
    笔记本连接4K显示器鼠标问题
  • 原文地址:https://www.cnblogs.com/zwl715/p/3816034.html
Copyright © 2020-2023  润新知