随笔分类 -  shell脚本

摘要:原文:https://blog.csdn.net/mpu_nice/article/details/106918188 实现思想:借鉴虚拟内存的思想,创建虚拟内存文件系统,不断写入数据达到消耗内存的目的,需要清除内存时,删除创建的虚拟内存目录即可。 #使用虚拟内存构造内存消耗 mkdir /tmp/ 阅读全文
posted @ 2021-11-08 11:04 wangmo 阅读(1756) 评论(0) 推荐(0) 编辑
摘要:https://www.jianshu.com/p/701952ffb755 正常情况下,Shell脚本是串行执行的,一条命令执行完才会执行接下来的命令。如下代码: # !/bin/bash for i in `seq 1 10` do echo $i done echo " end " 脚本执行的 阅读全文
posted @ 2019-06-21 15:02 wangmo 阅读(5058) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash action=$1 port=$2 file="/home/operation/workspace/renderingengine/engine/services.txt" #file="/tmp/services.txt" if [ $# -lt 2 ];then echo "\033[31m usage: sh $0 action port\033[0m"... 阅读全文
posted @ 2018-12-04 15:37 wangmo 阅读(240) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash path1=/home/htoa/tomcat/webapps/ROOT/htoa/ ip=192.168.30.13 /usr/bin/inotifywait -mrq --timefmt %y/%m'%d %H:/%M' --format '%T %w%f' -emodify,delete,create,attrib $path1 | while read fil... 阅读全文
posted @ 2018-05-23 18:17 wangmo 阅读(429) 评论(0) 推荐(0) 编辑
摘要:#!/bin/sh # this script can make certificate of each line in file you point which one! if [ $# -ne 1 ];then echo -e "\033[33m Input your domain's file \033[0m" exit 1 fi for line in `cat $1` d... 阅读全文
posted @ 2018-05-23 18:14 wangmo 阅读(729) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash count=0 run1=`curl -I 192.168.30.12:8000 | grep "200 OK" | wc -l` run2=`curl -I 192.168.30.12:8020 | grep "200 OK" | wc -l` run3=`curl -I 192.168.30.12:8080 | grep "200 OK" | wc -l... 阅读全文
posted @ 2018-05-23 18:01 wangmo 阅读(596) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash # Let's finish it like a flash # usage:sh -x update_cms_backend.sh -v 2018050401 ARGS=`getopt -o v:"$@"` echo $# if [ $# != 2 ];then echo "Need new version" exit fi case... 阅读全文
posted @ 2018-05-22 15:01 wangmo 阅读(1353) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash #wangmo #20171206 #Update xizang project code code=/root/code/xizang_PAD_project/PHP_business_server/tfcms path=/home/seim #ip=x.x.x.x ip=x.x.x.x time=`date +%Y%m%d-%H%M` upload=/home/se... 阅读全文
posted @ 2018-05-15 10:58 wangmo 阅读(221) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash #ip=x.x.x.x #pass='x.x.x.x' pass='x.x.x.x' time=`date +%Y%m%d-%H%M` db_path=/root/code/xizang_PAD_project/PHP_business_server/tfcms/upgrade/db/ db_name=tf_syberos_cms db_bak=/usr/local/s... 阅读全文
posted @ 2018-05-15 10:55 wangmo 阅读(217) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash date=`date +%Y%m%d-%H%M` count=0 count1=0 count2=0 ip1=124.117.246.195 ip2=124.117.246.194 port1=(443 80 6051 22101 11194) port2=(443 80) for (( k=0; k> /dev/null if [ $? != 0 ... 阅读全文
posted @ 2018-05-10 13:42 wangmo 阅读(227) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash if [ $# != 1 ];then echo "Param error";exit; fi DOCKER_NAME=$1 IMAGE_TAG=${DOCKER_NAME##*/} IMAGE=`echo $IMAGE_TAG | awk -F ':' '{print $1}'` TAG=`echo $IMAGE_TAG | awk -F ':' '... 阅读全文
posted @ 2018-05-09 11:54 wangmo 阅读(330) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash date=`date +%Y%m%d-%H%M` count=0 ip1=124.117.246.195 ip2=124.117.246.194 port1=(443 80 6051 22101 11194) port2=(443 80) for (( k=0; k<5; k 阅读全文
posted @ 2018-05-03 15:38 wangmo 阅读(192) 评论(0) 推荐(0) 编辑
摘要:#!/bin/sh # create self-signed server certificate: read -p "Enter your domain [www.example.com]: " DOMAIN echo "Create server key..." openssl genrsa -des3 -out $DOMAIN.key 1024 echo "Create serv... 阅读全文
posted @ 2017-12-13 10:37 wangmo 阅读(356) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash pass='123456' time=`date +%Y%m%d-%H%M` db_path=/root/code/xizang_PAD_project/PHP_business_server/tfcms/upgrade/db/ db_name=tf_syberos_cms db_bak=/usr/local/src/backup/$db_name-$time\.sql... 阅读全文
posted @ 2017-12-12 15:42 wangmo 阅读(814) 评论(0) 推荐(0) 编辑
摘要:1 #!/bin/bash 2 #连续4个小时ping不通远端主机,则本机关机。 3 4 begin_time=$(date "+%s") 5 while true;do 6 sleep 2 7 ping -c 1 172.16.160.1 > /dev/null 8 if [ $? != 0 ];then 9 end_time=$(d... 阅读全文
posted @ 2017-10-31 18:39 wangmo 阅读(691) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash #mo #20170911 #Update all oa code code=/root/code/$2/syberosoa path=/home/seim time=`date +%Y%m%d-%H%M` #Determine the results result() { if [ $? != 0 ];then echo -e "\033[3... 阅读全文
posted @ 2017-09-11 15:48 wangmo 阅读(213) 评论(0) 推荐(0) 编辑
摘要:#!/bin/sh if [ "$1"x = ""x ]; then echo "usage:/opt/bin/auto-ssh.sh user server" else user=$1 server=$2 pubkey=`cat ~/.ssh/id_rsa.pub` if [ "$pubkey"x = ""x ]; then ssh-ke... 阅读全文
posted @ 2017-09-11 15:46 wangmo 阅读(159) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash # Program: # system_init_shell # History: # 2012/06/01 25061008@qq.com # Release: # 1.1 cat /dev/null 2>&1 if [ $? -eq 0 ]; then echo "${i} is installed" ... 阅读全文
posted @ 2017-06-29 11:13 wangmo 阅读(409) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示