摘要: 判断是否安装了node if ! type node >/dev/null 2>&1; then echo 'node 未安装'; else echo 'node 已安装'; fi 判断是否安装了npm if ! type npm >/dev/null 2>&1; then Echo_Red 'np 阅读全文
posted @ 2020-10-19 10:44 cchilei 阅读(2155) 评论(0) 推荐(0) 编辑
摘要: 今天写了个es安装脚本,脚本安装过程中,需要重启es。 需求就是,根据es端口号,查到对应的pid,根据pid将进程杀死,然后重启。 shell中通过端口号查询pid esPort=8080 #根据端口号查询对应的pid pid=$(netstat -nlp|grep :$esPort|awk '{ 阅读全文
posted @ 2020-10-19 09:40 cchilei 阅读(1047) 评论(0) 推荐(0) 编辑