标签:nbsp 系统 map 是否存活 pass 提示 proc ps aux inux
#!/bin/bash
read -p "input pid :" pid
a=`ps aux | grep $pid | awk ‘{print $2}‘| grep ^$pid`
if [ "$pid" == "$a" ];then
cat /proc/$pid/status
else
echo "pid no "
fi
a(){
#!/bin/bash
sum=0
while [ $sum -lt 1 ];do
a=`nmap 192.168.1.47 | grep ^[0-9] | cut -d " " -f 2|head -1`
if [ "$a" == "open" ];then
echo "hostname is up"
elif [ "$a" == "" ];then
echo "hostname is down"
sleep 1
# echo "hostname is down" >> /data/f4
else
true
fi
let sum+=1
done
}
a | grep "hostname is down" && echo "hostname down" >/data/f4
[[ $1 =~ \.*sh$ ]] && [ -f $1 ] && chmod +x $1 || echo fei job file `exit`
禁止普通用户登录脚本
#!/bin/bash
sed -i -r ‘s@(.*[0-9]{4}.*:).*@\1/sbin/nologin@‘ /etc/passwd
#!/bin/bash
启用普通用户登录脚本
#!/bin/bash
sed -i -r ‘s@(.*[0-9]{4}.*:).*@\1/bin/bash@‘ /etc/passwd
#!/bin/bash
a=`cat /etc/passwd|head -10|tail -1|cut -d: -f3`
b=`cat /etc/passwd|head -20|tail -1|cut -d: -f3`
# echo `let ${a}+${b}`
let c=a+b
echo $c
unset a b
标签:nbsp 系统 map 是否存活 pass 提示 proc ps aux inux
原文地址:https://www.cnblogs.com/woaiyitiaochai/p/11757924.html