随笔分类 - 脚本
全是脚本
摘要:[root@ansible ansible]# cat host_name.sh #!/bin/bashHOSTIP=`ip a s ens33 | awk -F "[ /]+" 'NR==3{print $3}'`NAMEIP=`grep "$HOSTIP" host_name | awk '{p
阅读全文
摘要:#!/bin/bashstty erase ^h echo " 设置时区并同步时间 "ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &> /dev/nullif ! crontab -l |grep ntpdate &>/dev/nul
阅读全文
摘要:#!/bin/bashPS3="需要ping的网段:"select ip in 192.168.20.1 192.168.130.1 172.16.1.1; do case $ip in 192.168.20.1) IP=(192.168.20.11 192.168.20.12 192.168.20
阅读全文
摘要:#!/bin/bashecho "##########################################"echo "# 192.168.20.12 | oauth-server oauth-app #"echo "# 192.168.20.12 | im-server im-app
阅读全文
摘要:#!/bin/bashcase $1 in start) systemctl start $2 ;; stop) systemctl stop $2 ;; restart) systemctl restart $2 ;; all_restart) LIST="sshd nginx" for i in
阅读全文
摘要:#!/bin/bashDATA=/data/prog/projectIP1=172.16.1.41IP2=172.16.1.42IP3=172.16.1.43IP4=172.16.1.44IP5=172.16.1.45IP6=172.16.1.46IP7=172.16.1.49IP8=172.16.
阅读全文
摘要:#!/bin/bash echo " 马上就好,请稍后 "yum -y install sshpass >/dev/null ssh-keygen -f /root/.ssh/id_rsa -P ''NET=192.168.20export yesexport SSHPASS=123456for I
阅读全文
摘要:#!/bin/bashecho $USERworkhome=/lvnktest/dygaelasticsearch-service/workjar=${workhome}dygaelasticsearch-service.jarpid=`ps -ef|grep dygaelasticsearch-s
阅读全文
摘要:#!/bin/bash #提取根分区剩余空间disk_size=$(df / |awk '/\//{print $4}')#提取内存剩余空间mem_size=$(free |awk '/Mem/{print $4}')while :do#注意内存和磁盘提取的空间大小都是以 Kb 为单位if [ $d
阅读全文
摘要:#!/bin/bashfor i in {1..254} do ping -c2 -i0.3 -W1 192.168.4.$i &>/dev/null if [ $? -eq 0 ];then echo "192.168.4.$i is up" else echo "192.168.4.$i is
阅读全文
摘要:在jenkins上项目配置里 #!/bin/bashHOME="/${JOB_NAME}"HOST="192.168.130.134"scp ${WORKSPACE}/target/smart_city_manager_admin.jar root@${HOST}:${HOME}echo "复制 成
阅读全文
摘要:#!/bin/bash#clsn#设置解析#安装zabbix源、aliyu nYUM源rpm -ivh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpmyum clean allyu
阅读全文
摘要:安装包下载路径:https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz (官网) #!/bin/bash#yum -y install java-devel >/dev/null#sleep 1 tar xf /d
阅读全文
摘要:#!/bin/bashA=dyshop-ordercp -r dytourismcard $Ased -i 's/dytourismcard/'$A'/g' $A/deploy.shcat $A/deploy.shls $A 做项目推送用
阅读全文
摘要:#!/bin/sh#FileName: Monitor.sh#make by GuoYanLiang#source ~/.bash_profileexport LANG="zh_CN.GB2312"export LC_ALL="zh_CN.GB2312"export LC_CTYPE="zh_CN.
阅读全文
摘要:cd nginx-1.12.2useradd -s /sbin/nologin nginx./configuremakemake installyum -y install mariadb mariadb-server mariadb-develyum -y install php php-rpm
阅读全文
摘要:#!/bin/bash#关闭防火墙和selinuxsystemctl stop firewalld && setenforce 0 && echo "防火墙已关闭" || echo "请手动检查"systemctl disable firewalld &> /dev/nullecho ">>> 1.
阅读全文