验证root口令脚本
#!/bin/bash PWD=12321 if test -z $PWD;then read -p "输入 root 用户的口令: " PWD fi while true;do echo " root 口令验证中..." su oracle -c "echo $PWD|su root">/dev/null 2>&1 if test $? -eq 0;then echo "验证成功" exit break else echo "验证失败!" read -p "输入 root 用户的口令: " PWD fi done