文章 91
评论 1
浏览 166368
docker镜像上传下载脚本

docker镜像上传下载脚本

一、镜像下载以及替换tag list=`cat $1` #修改后的镜像仓库 Registry='harbor.zhangzhuo.org/base/' echo > images-save.txt echo > images-name.txt for var in $list;do #取镜像名称及tag tmp=${var##*/} #取镜像仓库url repo=${var%/*} #取镜像名称 project=${tmp%%:*} #取镜像tag tag=${tmp##*:} #修改原本镜像仓库url地址为新的的仓库url地址 eval new_image_url=${Registry}${tmp} #拉取镜像 docker pull ${var} #修改镜像tag docker tag ${var} ${new_image_url} #导出镜像 docker save ${new_image_url} -o ${project}-${tag}.tar.gz #记录导出的文件名称 echo ${project}-${tag}.tar.gz >> images-....

Jenkins代码升级脚本示例

Jenkins代码升级脚本示例

[20:57:03 root@jenkins jenkins]#cat web1.sh #!/bin/bash DATE=`date +"%Y-%m-%d_%H-%M-%S"` GROUP="$1" BRANCH="$2" IP_list(){ if [ ${GROUP} == "GROUP1" ];then HOST_IP='192.168.10.183' echo "${HOST_IP}" elif [ ${GROUP} == "GROUP2" ];then HOST_IP='192.168.10.184' echo "${HOST_IP}" elif [ ${GROUP} == "GROUP3" ];then HOST_IP='192.168.10.183 192.168.10.184' echo "${HOST_IP}" fi } clone_code(){ echo "即将开始从clone ${BRANCH}分支代码" cd /data/jenkins/git && rm -rf * && git clone -b ${BRANCH} git@....

SSH认证脚本

SSH认证脚本

#要认证的主机IP IP=" 192.168.10.182 " #centos开启 #rpm -q sshpass &>/dev/null || yum -y install sshpass #ubuntu开启 dpkg -L sshpass &>/dev/null || apt -y install sshpass [ -f /root/.ssh/id_rsa ] || ssh-keygen -f /root/.ssh/id_rsa -P '' #登录密码 export SSHPASS=123456 for HOST in $IP;do sshpass -e ssh-copy-id -o StrictHostKeyChecking=no $HOST done

OpenVPN一键安装脚本

OpenVPN一键安装脚本

#!/bin/bash # #******************************************************************** #Author:zhangzhuo #QQ: 1191400158 #Date: 2021-01-26 #FileName:openvpn_install.sh #URL: https://www.zhangzhuo.ltd #Description:The test script #Copyright (C): 2021 All rights reserved #******************************************************************** . /etc/init.d/functions openvpn_install_centos(){ while :;do read -p "请输入OpenVPN服务器公网IP: " IP { echo $IP | grep -E "^(([1-9]?[0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])....

Centos与Ubuntu初始化shell脚本

Centos与Ubuntu初始化shell脚本

#!/bin/bash # #******************************************************************** #Author:zhangzhuo #QQ: 1191400158 #Date: 2020-12-18 #FileName:reset_Linux_OS_v4.sh #URL: [https://www.zhangzhuo.ltd](https://www.zhangzhuo.ltd) #Description:The test script #Copyright (C): 2020 All rights reserved #******************************************************************** Centos(){ centos_Version(){ Version=`grep -Eo "[0-9].[0-9]" /etc/redhat-release | tr '.' '%' | tr '\n' % |cut -d% -f 1` #Version=`se....

生而为人