#
# History: 2018/01/14 zhuwei First release
#-----------------------------------------------------------------------------------------------
# set a safe path before doing anything else
PATH=/sbin:/usr/sbin:/bin:/usr/bin; export PATH
# This script must be executed as root
RUID=`/usr/bin/id|awk -F\( {print $1}|awk -F\= {print $2}`
if [ ${RUID} != "0" ] ; then
echo "This script must be executed as root"
exit 1
fi
upassword=$2
# Display an error and exit
errorExit() {
echo "$@" >&2
exit 1
}
# Display the normal print
displayheader() {
echo -e "\033[32m********************************************************************\033[0m"
echo -e "\033[32m*\033[0m"$@""
echo -e "\033[32m********************************************************************\033[0m"
echo ""
}
#-----------------------------------------------------------------------------------------------
CheckPath(){
if [ ! -n "$path" ]; then
printf "\n\tYou input is invalid!\n"
GetPath $1
fi
if [ ! -d "$path" ]; then
mkdir -p $path
pathsize=`df "$path"|sed 1d |awk {print $4}`
if [ $pathsize -lt 31457820 ] ; then
printf "The path -ge 30gb will be created! \n"
rm -rf $path
GetPath $1
else
return 0
fi
else
#path=`echo "$path"|awk -F "/" {print $NF}`
pathsize=`df "$path"|sed 1d |awk {print $4}`
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/bofangqi/article-62078-10.html
靠忽悠
说明人家还是看不起我们