#common. SH, which is mainly some function # perform compiled cleanup work function make_clean { # $RE _ins based on the value of the variable, To determine whether to perform cleanup work if [ $RE _ins == 1 ]; then make clean >/dev/null 2>&1 fi}# Download function function wget_down { #判断 $SOFT The value of _down, if 1, perform the download if [ $SOFT _down == 1 ]; then echo "Start down ..." for i in $*; do [ $ (wget -c $i) ] && exit done fi}# Error Exit Function function err_exit { echo echo echo&nbsP; " ----install error: $1 -----------" echo echo exit } #错误函数function error { echo "error: $1"     EXIT     } #文件复制函数function file_cp { [ -f $2 ] && mv $2 ${2}$ (date +%y%m%d%h) cd $IN _pwd/conf [ -f  $1 ] && CP -F $1 $2} #文件复制函数function file_cpv { cd $IN _pwd/conf [ -f $1 ] &&  CP -F $1 $2} #文件删除函数function file_rm { [ -f $1  ] && RM -F $1} #文件备份函数function file_bk { [ -f $1 ] && mv $1 ${1}_$ (date +%y%m%d%h)} #配置完成提示函数function lanmp_in_finsh { echo echo echo echo " congratulations ,lanmp install is complete" echo "      VISIT HTTP://IP" echo " more infomation please visit 51cto.com " echo}
WDCP Environment Build shell script Analysis--lanmp.sh---lib/common.sh