#!/bin/sh
function start_base() {
cd occ-base-web
ps -ef | grep occ-base-web-1.0.0.jar | grep -v grep | awk '{print $2}' | xargs kill -9
java -jar occ-base-web-1.0.0.jar --spring.profiles.active=maydostwo > out.log &
}
function start_cmpt() {
cd occ-cmpt-web
ps -ef | grep occ-cmpt-web-1.0.0.jar | grep -v grep | awk '{print $2}' | xargs kill -9
java -jar occ-cmpt-web-1.0.0.jar --spring.profiles.active=maydostwo > out.log &
}
function start_stock() {
cd occ-stock-web
ps -ef | grep occ-stock-web-1.0.0.jar | grep -v grep | awk '{print $2}' | xargs kill -9
java -jar occ-stock-web-1.0.0.jar --spring.profiles.active=maydostwo > out.log &
}
function start_buyer() {
cd occ-b2b-buyer-web
ps -ef | grep occ-b2b-buyer-web-1.0.0.jar | grep -v grep | awk '{print $2}' | xargs kill -9
java -jar occ-b2b-buyer-web-1.0.0.jar --spring.profiles.active=maydostwo > out.log &
}
function help() {
echo "input: ./start.sh + [all | base | cmpt | stock | buyer]" >&2
echo " "
}
command=$1
shift 1
case $command in
base)
start_base;
;;
cmpt)
start_cmpt;
;;
stock)
start_stock;
;;
buyer)
start_buyer;
;;
all)
start_base;
sleep 30
start_cmpt;
sleep 30
start_stock;
sleep 30
start_buyer;
;;
*)
help;
exit 1;
;;
esac