# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

echo "Reminder of the commands:
 * pstart: to start all the services
 * pstop:  to stop all the services
 * prestart: to restart all the services
 * plog:   to access the logs of the 'pagure' service (the web server)"

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions
# If adding new functions to this file, note that you can add help text to the function
# by defining a variable with name _<function>_help containing the help text

pstart (){
    sudo systemctl start pagure.service \
        pagure-docs.service \
        pagure_ci.service \
        pagure_ev.service \
        pagure_webhook.service \
        pagure_worker.service \
        pagure_authorized_keys_worker.service
    echo 'The application is running on http://localhost:5000/'
}

pstop (){
    sudo systemctl stop pagure.service \
        pagure-docs.service \
        pagure_ci.service \
        pagure_ev.service \
        pagure_webhook.service \
        pagure_worker.service \
        pagure_authorized_keys_worker.service
}

prestart (){
    sudo systemctl restart pagure.service \
        pagure-docs.service \
        pagure_ci.service \
        pagure_ev.service \
        pagure_webhook.service \
        pagure_worker.service \
        pagure_authorized_keys_worker.service
    echo 'The application is running on http://localhost:5000/'
}

pstatus (){
    sudo systemctl status pagure.service \
        pagure-docs.service \
        pagure_ci.service \
        pagure_ev.service \
        pagure_webhook.service \
        pagure_worker.service \
        pagure_authorized_keys_worker.service
}

alias plog="sudo journalctl -lu pagure.service"
