#!/bin/bash INSTALLER_PID=$(ss -lntpd | grep :10000|awk -F ',' '{print $2}'|awk -F '=' '{print $2}'); if [[ -z '$INSTALLER_PID' ]]; then echo '未发现运行中的安装器'; exit 1; fi INSTALLER_PATH=$(ls -l "/proc/$INSTALLER_PID" |grep exe|awk -F ' ' '{print $NF}'|awk -F '/tools/middleware' '{print $NR}') if [[ ! -f "${INSTALLER_PATH}/config/iuap_server.conf" ]]; then echo '未发现运行中的安装器' exit 1; fi
${INSTALLER_PATH}/tools/mysql/bin/mysql -P 10007 -u root -pyonyou*123 -D azq -S ${INSTALLER_PATH}/tools/mysql/data/mysql.sock <update iuap_server_queue set status='3' where obj_type='uninstall_pack' and status='0' and obj_id in (SELECT product_id from iuap_server_prod where un_install_progress='nginxConfig') ; update iuap_server_prod_app_pack_instance set uninstall_status='3' WHERE uninstall_status='0' and product_id in (SELECT product_id from iuap_server_prod where un_install_progress='nginxConfig'); update iuap_server_prod set un_install_progress='packUnInstall' where un_install_progress='nginxConfig'; EOF
1 个回复
nccloud
在安装器主机执行脚本后刷新即可,脚本见下文或附件
skip_nginx_uninstall.sh
#!/bin/bash
update iuap_server_queue set status='3' where obj_type='uninstall_pack' and status='0' and obj_id in (SELECT product_id from iuap_server_prod where un_install_progress='nginxConfig') ;
INSTALLER_PID=$(ss -lntpd | grep :10000|awk -F ',' '{print $2}'|awk -F '=' '{print $2}');
if [[ -z '$INSTALLER_PID' ]]; then
echo '未发现运行中的安装器';
exit 1;
fi
INSTALLER_PATH=$(ls -l "/proc/$INSTALLER_PID" |grep exe|awk -F ' ' '{print $NF}'|awk -F '/tools/middleware' '{print $NR}')
if [[ ! -f "${INSTALLER_PATH}/config/iuap_server.conf" ]]; then
echo '未发现运行中的安装器'
exit 1;
fi
${INSTALLER_PATH}/tools/mysql/bin/mysql -P 10007 -u root -pyonyou*123 -D azq -S ${INSTALLER_PATH}/tools/mysql/data/mysql.sock <
update iuap_server_prod_app_pack_instance set uninstall_status='3' WHERE uninstall_status='0' and product_id in (SELECT product_id from iuap_server_prod where un_install_progress='nginxConfig');
update iuap_server_prod set un_install_progress='packUnInstall' where un_install_progress='nginxConfig';
EOF