#!/bin/bash export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin clear printf " # Name: Downtown_Shell_Deploy_Script # # Purpose:Deploy tar.gz to the host # # Notes: # 1 Upload your tar.gz file to the path /data/source # # 2 ./script_name Filename.postfix # For Example:./New_UPDATE_nodejs_tar_update.sh buffetmealapi.tar.gz # # Return codes: # 启动时间 启动程序 # 14:26 nodejs ######################################################## " #check user if [ $(id -u) != "0" ] then echo "Error: You must be root to run this script!!!" exit 1 fi if [ -z "$1" ];then echo "Usage:script.sh file.tar.gz" exit else echo "执行文件名: $1" fi #Define Project_Name_file=$1 #buffetmealapi.tar.gz Project_Name=${Project_Name_file%%.*} #buffetmealapi INIT_SCRIPT_URL=/data/source Config_URL=/data/config Project_Name_Suffix=${Project_Name_file#*.} #tar.gz ##工程目录 PROJECT_NODE_APP_PATH="/data/app/eshine/$Project_Name" ##源配置文件模板目录 PROJECT_NODE_APP_CONFIG_TEMPLATES_PATH="/data/app/eshine/$Project_Name/config-templates" #/data/app/eshine/storeapi/config-templates/ ##目标配置文件目录 PROJECT_NODE_APP_CONFD_PATH="/data/app/confd/config/$Project_Name" #/data/app/confd/config/storeapi function_deploy_tar_gz() { source /etc/profile echo -e "