kok202
Sentry on-premise 로컬 서버 start, stop 쉘스크립트

2019. 4. 1. 18:14[정리] 기능별 개념 정리/Sentry

#!/bin/bash
source ~/Desktop/LocalSentry/sentry/bin/activate
PIDS_PATH="sentry_pids.txt"

start() {
    echo "Start sentry web ...";
    sentry run web&
    echo $! > $PIDS_PATH
    
    echo "Start sentry worker";
    sentry run worker&
    echo $! >> $PIDS_PATH

    echo "Start sentry cron";
    sentry run cron&
    echo $! >> $PIDS_PATH
}

stop(){
    while read -r PID; do
        kill $PID
    done < $PIDS_PATH
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        stop
        start
        ;;
    *)
        echo $"Usage: $0 {start|stop|restart}"
        RETVAL=2
esac