#!/usr/bin/env bash


sudo rm -fr /usr/lib/systemd/system/majora.service
sudo systemctl daemon-reload
sudo systemctl stop majora.service

old_pid=$(ps -ef | grep majora | grep -v grep | awk '{print $2}')

echo "old pid is ${old_pid}"

echo "clean old ..."

`ps -ef | grep majora | grep -v grep | awk '{print $2}'| xargs kill -9`

mkdir -p output/log

exec ./majora -daemon -conf majora.yaml