#!/bin/bash

source ./common.sh

instances=(${1//,/ })
n=$2

for i in ${instances[@]}
do
    pm2 delete ecosystem.config.js --only ${PROJECT_NAME}_n${n}_i${i} $n $i ${SCRIPT}
    pm2 start ecosystem.config.js --only ${PROJECT_NAME}_n${n}_i${i} $n $i ${SCRIPT}
done

echo 'success'
