1 #!/bin/bash 2 ip=$(ip a s ens33 grep -Eo([0-9](1,3)\.)(3)[0-9](1,3) head -1) 3 echo $ip 4 5 groupadd app 6 if [ `echo $ip | grep 3` ];then 7 for i in `seq 100` 8 do 9 if (( $i < 10 ));then 10 useradd -g app app_0$i 11 else 12 useradd -g app app_$i 13 fi 14 done 15 else 16 date 17 fi 18 19 grep -v nologin /etc/passwd | cut -d: -f1 20 21 yum install nginx -y 22 systemctl start nginx
标签:脚本,神秘,grep,ip,app,echo,nginx,else From: https://www.cnblogs.com/Tazimiz/p/17467637.html