本文参考51CTO博客作者wjw555的作品
脚本内容:
vim install.mysql.sh
#!/bin/bash
[ -f /etc/init.d/functions ]&& . /etc/init.d/functions
###Check if user is root
if [ $UID -ne 0 ]; then
echo Error: You must be root to run this script, please use root to install
exit 1
fi
clear
echo ===============================
1