寫的簡單sh腳本2

#!/bin/bash
export LANG="en_US.UTF-8"
#chmod +x filename 記得給文件加可執行權限
#./vsimstart.sh
#啓動vsim項目
echo "start vism"
#207------------------------------
assets=vsim-assets-1.1.02.1014-monitor
user=vsim-user-1.1.02.1014-monitor
res=vsim-res-1.1.02.1014-monitor
vsim_product=vsim-product-1.1.02.1014-monitor
srms_provider=srms-provider-1.1.02.1014-monitor
sqb_node=sqb-node-1.1.02.1101
uqb_node=uqb-node-1.1.02.1101
uqb_agent=uqb-agent-1.1.02.1101
#204------------------------------
access=vsim-access-1.1.02.1101
cfgs=vsim-cfgs-1.1.02.1101-SNAPSHOT
lps=vsim-lps-1.1.02.1101
tls=vsim-tls-1.1.02.1101
dms=vsim-dms-1.1.02.1101
msgq=vsim-msgq-1.1.02.1101
rss=vsim-rss-1.1.02.1101-SNAPSHOT
dse=vsim-dse-1.1.02.1101
dre=vsim-dre-1.1.02.1101-SNAPSHOT
sc=vsim-sc-1.1.02.1101
apdu=vsim-apdu-1.1.02.1101
cdr=vsim-cdr-1.1.02.1101
mno_provider=mno-provider-1.1.01.0930
vsim_ebiz=vsim-ebiz-1.1.02.1101
srms_web=srms-1.1.02.1014-monitor
#204額外啓動 
vsim_web=/usr/local/apache-tomcat-7.0.56/bin
amc=vsim-access-1.1.02.1101/amc-bin


# 啓動207應用
#vsims="${assets} ${user} ${res} ${vsim_product} ${srms_provider} ${sqb_node} ${uqb_node} ${uqb_agent}"
# 啓動204應用
vsims="${access} ${cfgs} ${lps} ${tls} ${dms} ${msgq} ${rss} ${dse} ${dre} ${sc} ${apdu} ${cdr} ${mno_provider} ${vsim_ebiz} ${srms_web}"

for vsim in ${vsims}; do
    if [ -d /home/vsim/${vsim}/bin ]
    then
    echo "有/home/vsim/${vsim}/bin"
    cd /home/vsim/${vsim}/bin
    sh ./shutdown.sh;
    sh ./startup.sh;
    else
    echo "沒有/home/vsim/${vsim}/bin文件目錄"
    fi
done

if [ -d ${vsim_web} ]
    then
    echo "有${vsim_web}文件目錄"
    cd ${vsim_web}
    sh ./shutdown.sh;
    sh ./startup.sh;
    else
    echo "沒有${vsim_web}文件目錄"
fi

if [ -d /home/vsim/${amc} ]
    then
    echo "有/home/vsim/${amc}"
    cd /home/vsim/${amc}
    sh ./shutdown.sh;
    sh ./startup.sh;
    else
    echo "沒有/home/vsim/${amc}文件目錄"
fi
echo "end vsim"
相關文章
相關標籤/搜索