Weblogic start/stop script
Start weblogic
Determine whether to enable the service by using the port.
#! /Bin/bash # author: wjf # date: # test environment: wls1036 horizontal cluster v_curr_user = 'whoam' v _ start_user = uweblogic # ------------ user v_admin_url = http: // 10.10.71.106: 9001 # ------------ manage the server's urlv_dir_domain_bin =/weblogic/Oracle/Middleware/user_projects/domains/gyhr_domain/bin # ------------ start the bin directory path of the domain v_admin_port = 9001 # ------------ weblogic manage # determine whether to enable f_is_service_start () when the service is enabled Based on the Service port () {v_is_port_open = 0 while [$ {v_is_port_open}-eq 0] dosleep 10v_is_port_open = 'netstat-ano | grep $ {1} | wc-l 'done} # Start the managed server f_start_ms () {echo "Start managed server $ {1}" cd $ {v_dir_domain_bin} nohup. /startManagedWebLogic. sh ${1 }$ {v_admin_url} & f_is_service_start $ {2} echo "$ {1} After startup" echo ""} # Main Code part if [$ {v_curr_user} = $ {v_start_user}] then # echo in the startup Service Code section "Start Management Server" cd $ {v_dir_domain_bin} nohup. /startWebLogic. sh & f_is_service_start $ {v_admin_port} echo "Start the Management server" echo "" # ----------------- modify the custom part (start) ------------------ f_start_ms server 8088 # --------------- modify the custom part (end) ------------------- elseecho "the current user is $ {v_curr_user}" echo "we recommend that you use $ {v_start_user} to start the service" echo "check the current user environment" fi
Stop script
Force shutdown with killall java. If other java programs are running in the system, this script is not applicable.
Cd/home/weblogic/bea/user_projects/domains/nc6domain/nc6domain/bin. /stopManagedWebLogic. sh Proxy & sleep 20. /stopManagedWebLogic. sh server1 & sleep 20. /stopWebLogic. sh & sleep 15v_java_process_num = 'ps-ef | grep java | wc-l' while [! $ {V_java_process_num}-eq 1] do killall java sleep 1 v_java_process_num = 'ps-ef | grep java | wc-l 'doneecho "weblogic disabled successfully"