👌 修改脚本

This commit is contained in:
Zhang Peng 2017-12-27 13:50:47 +08:00
parent 345d2acd9a
commit 0198e10b70

View File

@ -7,7 +7,6 @@ init() {
echo "${IP} 机器环境部署开始" |tee ${DEPLOY_LOG_PATH} echo "${IP} 机器环境部署开始" |tee ${DEPLOY_LOG_PATH}
touch ${DEPLOY_LOG_PATH} touch ${DEPLOY_LOG_PATH}
chmod 777 ${DEPLOY_LOG_PATH} chmod 777 ${DEPLOY_LOG_PATH}
git clone git@github.com:dunwu/linux-notes.git ${SOURCE_PATH}/linux-notes
} }
# 获取当前机器 IP # 获取当前机器 IP
@ -30,7 +29,10 @@ initEnviromentConfig() {
then then
cp /etc/profile /etc/profile.bak cp /etc/profile /etc/profile.bak
fi fi
cat ${SOURCE_PATH}/linux-notes/codes/deploy/profile >> /etc/profile cd ${TMP_PATH}
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" https://github.com/dunwu/linux-notes/blob/master/codes/deploy/profile
cat ${TMP_PATH}/profile >> /etc/profile
rm -rf ${TMP_PATH}/profile
source /etc/profile source /etc/profile
} }
@ -75,11 +77,13 @@ installNginx() {
} }
installNodejsAndNvm() { installNodejsAndNvm() {
echo "安装 Nodejs" | tee ${DEPLOY_LOG_PATH} echo "安装 Nvm 和 Nodejs" | tee ${DEPLOY_LOG_PATH}
yum install -y nodejs npm --enablerepo=epel rm -rf /home/admin/.nvm
git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm
source ~/.nvm/nvm.sh source ~/.nvm/nvm.sh
nvm install 0.10.48
} }
shutdownFirewall() { shutdownFirewall() {
@ -99,7 +103,7 @@ setPrivilegeForUserIns() {
} }
##############################__MAIN__######################################## ##############################__MAIN__########################################
DEPLOY_LOG_PATH=/home/zp/deploy.log DEPLOY_LOG_PATH=/home/zp/deploy.log
SOURCE_PATH=/home/zp/source TMP_PATH=/home/zp/
SOFTWARE_PATH=/usr/lib SOFTWARE_PATH=/usr/lib
init init