通过传参实现函数调用
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | #!/bin/bash . /etc/rc .d /init .d /functions export JAVA_HOME= /usr/java/jdk1 .8.0_111 export PATH=$JAVA_HOME /bin :$PATH export CLASSPATH=.:$JAVA_HOME /lib/dt .jar:$JAVA_HOME /lib/tools .jar APP_NAME=$1 BUCKUP_DIR= /fs02/backup/spring-cloud/TPP/tpp- ${APP_NAME}/$( date +%Y%m%d%H%M) APP_DIR= /fs01/spring-cloud/TPP FILE=tpp-${APP_NAME}-3.1.0.jar [ -z ${BUCKUP_DIR} ] || /bin/mkdir -p ${BUCKUP_DIR} cd ${APP_DIR} /tpp- ${APP_NAME} tar -cf ${BUCKUP_DIR} /tpp- ${APP_NAME}. tar BOOT-INF/ META-INF/ ps aux| grep tpp-${APP_NAME}| grep - v grep | awk '{print $2}' | xargs kill -9 rm -fr ${APP_DIR} /tpp- ${APP_NAME} /application .pid cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/ #更新tpp-acc账户应用 acc(){ /bin/mv applicationContext.xml application.yml db.properties logback-spring.xml service_interface.properties twhapi.properties ../ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/config/ /bin/mv acp_sdk.properties ../ cd ${APP_DIR} /tpp- ${APP_NAME} /usr/java/jdk1 .8.0_111 /bin/jar -xf ${APP_DIR} /tpp- ${APP_NAME}/${FILE} cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/ \ /bin/mv .. /applicationContext .xml .. /application .yml .. /db .properties .. /logback-spring .xml .. /service_interface .properties .. /twhapi .properties ./ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/config/ \ /bin/mv .. /acp_sdk .properties ./ /bin/chown -R tomcat8:tomcatg ${APP_DIR} /tpp- ${APP_NAME} cd ${APP_DIR} /tpp- ${APP_NAME}/ && . /start .sh } #更新tpp-api云通卡 api(){ /bin/mv applicationContext.xml application.yml db.properties logback-spring.xml service_interface.properties twhapi.properties ../ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/config/ /bin/mv acp_sdk.properties CaCert.properties cardStroe_Config.properties cardTemplate_Config.properties hct-config.properties netsignagent.properties pay_link.properties ra.jks ra.p7b ../ cd ${APP_DIR} /tpp- ${APP_NAME} /usr/java/jdk1 .8.0_111 /bin/jar -xf ${APP_DIR} /tpp- ${APP_NAME}/${FILE} cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/ \ /bin/mv .. /applicationContext .xml .. /application .yml .. /db .properties .. /logback-spring .xml .. /service_interface .properties .. /twhapi .properties ./ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/config/ \ /bin/mv .. /acp_sdk .properties .. /CaCert .properties .. /cardStroe_Config .properties .. /cardTemplate_Config .properties .. /hct-config .properties .. /netsignagent .properties .. /pay_link .properties .. /ra .jks .. /ra .p7b ./ /bin/chown -R tomcat8:tomcatg ${APP_DIR} /tpp- ${APP_NAME} cd ${APP_DIR} /tpp- ${APP_NAME}/ && . /start .sh } #更新tpp-channel云通道 channel(){ /bin/mv applicationContext.xml application.yml db.properties logback-spring.xml service_interface.properties twhapi.properties pay_link.properties ../ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/config/ /bin/mv channel.properties ../ cd ${APP_DIR} /tpp- ${APP_NAME} /usr/java/jdk1 .8.0_111 /bin/jar -xf ${APP_DIR} /tpp- ${APP_NAME}/${FILE} cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/ \ /bin/mv .. /applicationContext .xml .. /application .yml .. /db .properties .. /logback-spring .xml .. /service_interface .properties .. /twhapi .properties .. /pay_link .properties ./ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/config/ \ /bin/mv .. /channel .properties ./ /bin/chown -R tomcat8:tomcatg ${APP_DIR} /tpp- ${APP_NAME} cd ${APP_DIR} /tpp- ${APP_NAME}/ && . /start .sh } #更新tpp-message消息推送 message(){ /bin/mv applicationContext.xml application.yml db.properties logback-spring.xml twhapi.properties ../ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/config/ /bin/mv pay_link.properties ../ cd ${APP_DIR} /tpp- ${APP_NAME} /usr/java/jdk1 .8.0_111 /bin/jar -xf ${APP_DIR} /tpp- ${APP_NAME}/${FILE} cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/ \ /bin/mv .. /applicationContext .xml .. /application .yml .. /db .properties .. /logback-spring .xml .. /twhapi .properties ./ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/config/ \ /bin/mv .. /pay_link .properties ./ /bin/chown -R tomcat8:tomcatg ${APP_DIR} /tpp- ${APP_NAME} cd ${APP_DIR} /tpp- ${APP_NAME}/ && . /start .sh } #更新tpp-mkt营销应用 mkt(){ /bin/mv applicationContext.xml application.yml db.properties logback-spring.xml service_interface.properties twhapi.properties ../ cd ${APP_DIR} /tpp- ${APP_NAME} /usr/java/jdk1 .8.0_111 /bin/jar -xf ${APP_DIR} /tpp- ${APP_NAME}/${FILE} cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/ \ /bin/mv .. /applicationContext .xml .. /application .yml .. /db .properties .. /logback-spring .xml .. /service_interface .properties .. /twhapi .properties ./ /bin/chown -R tomcat8:tomcatg ${APP_DIR} /tpp- ${APP_NAME} cd ${APP_DIR} /tpp- ${APP_NAME}/ && . /start .sh } #更新tpp-pay支付应用 pay(){ /bin/mv applicationContext.xml application.yml db.properties logback-spring.xml service_interface.properties twhapi.properties ../ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/pay/ /bin/mv acp_applepay_sdk.properties acp_sdk.properties pay_link.properties pay.properties ../ cd ${APP_DIR} /tpp- ${APP_NAME} /usr/java/jdk1 .8.0_111 /bin/jar -xf ${APP_DIR} /tpp- ${APP_NAME}/${FILE} cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/ \ /bin/mv .. /applicationContext .xml .. /application .yml .. /db .properties .. /logback-spring .xml .. /service_interface .properties .. /twhapi .properties ./ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/pay/ \ /bin/mv .. /acp_applepay_sdk .properties .. /acp_sdk .properties .. /pay_link .properties .. /pay .properties ./ /bin/chown -R tomcat8:tomcatg ${APP_DIR} /tpp- ${APP_NAME} cd ${APP_DIR} /tpp- ${APP_NAME}/ && . /start .sh } #更新tpp-pre前置应用 pre(){ /bin/mv application.yml logback-spring.xml ../ cd ${APP_DIR} /tpp- ${APP_NAME} /usr/java/jdk1 .8.0_111 /bin/jar -xf ${APP_DIR} /tpp- ${APP_NAME}/${FILE} cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/ \ /bin/mv .. /application .yml .. /logback-spring .xml ./ /bin/chown -R tomcat8:tomcatg ${APP_DIR} /tpp- ${APP_NAME} cd ${APP_DIR} /tpp- ${APP_NAME}/ && . /start .sh } #更新tpp-rcs风控系统 rcs(){ mkt } #更新tpp-small小程序 small(){ /bin/mv applicationContext.xml application.yml db.properties logback-spring.xml service_interface.properties twhapi.properties ../ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/config/ /bin/mv pay_link.properties ../ cd ${APP_DIR} /tpp- ${APP_NAME} /usr/java/jdk1 .8.0_111 /bin/jar -xf ${APP_DIR} /tpp- ${APP_NAME}/${FILE} cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/ \ /bin/mv .. /applicationContext .xml .. /application .yml .. /db .properties .. /logback-spring .xml .. /service_interface .properties .. /twhapi .properties ./ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/config/ \ /bin/mv .. /pay_link .properties ./ /bin/chown -R tomcat8:tomcatg ${APP_DIR} /tpp- ${APP_NAME} cd ${APP_DIR} /tpp- ${APP_NAME}/ && . /start .sh } #更新tpp-spoon云匙应用 spoon(){ /bin/mv applicationContext.xml application.yml db.properties logback-spring.xml twhapi.properties ../ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/spoon/ /bin/mv das-config.properties doorControlPre-config.properties hct-config.properties jdFacePre-config.properties jiadu201710Client.cer ../ cd ${APP_DIR} /tpp- ${APP_NAME} /usr/java/jdk1 .8.0_111 /bin/jar -xf ${APP_DIR} /tpp- ${APP_NAME}/${FILE} cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/ \ /bin/mv .. /applicationContext .xml .. /application .yml .. /db .properties .. /logback-spring .xml .. /twhapi .properties ./ cd ${APP_DIR} /tpp- ${APP_NAME} /BOOT-INF/classes/spoon/ \ /bin/mv .. /das-config .properties .. /doorControlPre-config .properties .. /hct-config .properties .. /jdFacePre-config .properties .. /jiadu201710Client .cer ./ /bin/chown -R tomcat8:tomcatg ${APP_DIR} /tpp- ${APP_NAME} cd ${APP_DIR} /tpp- ${APP_NAME}/ && . /start .sh } #更新tpp-common公用项目 common(){ tar -cf ${BUCKUP_DIR} /tpp- ${APP_NAME}. tar tpp-common-3.1.0.jar ps aux| grep tpp-| grep - v tpp-pre| grep - v grep | awk '{print $2}' | xargs kill -9 find /fs01/spring-cloud/TPP/ - type d -name "lib" ! -path "/fs01/spring-cloud/TPP/tpp-zuul-pre/*" ! -path "${APP_DIR}/tpp-${APP_NAME}/*" - exec cp ${APP_DIR} /tpp- ${APP_NAME} /tpp-common-3 .1.0.jar {} \; cd /fs01/spring-cloud/TPP/tpp-acc && . /start .sh cd /fs01/spring-cloud/TPP/tpp-api && . /start .sh cd /fs01/spring-cloud/TPP/tpp-channel && . /start .sh cd /fs01/spring-cloud/TPP/tpp-message && . /start .sh cd /fs01/spring-cloud/TPP/tpp-mkt && . /start .sh cd /fs01/spring-cloud/TPP/tpp-pay && . /start .sh cd /fs01/spring-cloud/TPP/tpp-rcs && . /start .sh cd /fs01/spring-cloud/TPP/tpp-small && . /start .sh cd /fs01/spring-cloud/TPP/tpp-spoon && . /start .sh } case ${APP_NAME} in acc) acc ;; api) api ;; channel) channel ;; message) message ;; mkt) mkt ;; pay) pay ;; pre) pre ;; rcs) rcs ;; small) small ;; spoon) spoon ;; common) common ;; *) exit 0 ;; esac |
如对您有帮助,支持下呗!
微信

支付宝

分类:
Shell
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类