shell
两小无猜闭月羞花
这个作者很懒,什么都没留下…
展开
-
shell多进程脚本(多线程)
背景是创建一千个用户,5个进程同时跑可以根据自己的需求自己修改代码即可。#!/bin/bashthread=5tmp_fifofile=/tmp/$$.filomkfifo $tmp_fifofileexec 8<> $tmp_fifofilerm $tmp_fifofilefor i in seq $threaddoecho >&8donefor i in {1…1000}do read -u 8{useradd testiecho123∣原创 2021-04-07 11:37:51 · 295 阅读 · 0 评论 -
Linux批量推送公钥(免密登录)
centos7环境的脚本本机必需要有expect或者配置了yum添加被推送的ipvi iplist.txtpassword=修改为被推送机器密码ip.log是可以ping通的机器代码如下:#!/usr/bin/baship.logpassword=CentOSif [ ! -f ~/.ssh/id_rsa ];thenssh-keygen -P “” -f ~/.ssh/id_rsafirpm -q expect &>/dev/nullif [ $? -ne原创 2021-04-07 11:31:19 · 326 阅读 · 0 评论