fix: explicitly ignore SIGINT signal
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

vrising
Davide Polonio 2023-05-25 10:58:51 +02:00
parent 15ce6246fe
commit c47158ee88
1 changed files with 6 additions and 5 deletions

View File

@ -21,7 +21,7 @@ editWithRestart() {
nano "${full_path_file_to_edit}"
stdout "The server will now be restarted and you will be attached to the logs."
stdout "Use ctrl-c to detach from the logs (the service will continue to run in background)"
(cd "${VRISING_COMPOSE_HOME}" && bash -c "docker-compose restart && docker-compose logs -f")
(cd "${VRISING_COMPOSE_HOME}" && docker-compose restart && docker-compose logs -f)
}
USERNAME="${1}"
@ -37,7 +37,8 @@ LOGS_FOLDER="${HOME}/logs"
mkdir -p "${LOGS_FOLDER}" || (stderr "Unable to create logs folder, exiting" && exit 1)
stdout "Welcome ${USERNAME}, please remember that your current activity in the server is logged!"
stdout "Exit and logout at any moment by pressing ctrl-c"
trap "" INT
while true
do
@ -66,15 +67,15 @@ Select one of the following actions:
;;
3)
stdout "Use ctrl-c to detach from the logs at any time"
(cd "${VRISING_COMPOSE_HOME}" && bash -c "docker-compose logs -f")
(cd "${VRISING_COMPOSE_HOME}" && docker-compose logs -f)
;;
4)
stdout "Use ctrl-c to detach from the logs at any time"
(cd "${VRISING_COMPOSE_HOME}" && bash -c "docker-compose restart && docker-compose logs -f")
(cd "${VRISING_COMPOSE_HOME}" && docker-compose restart && docker-compose logs -f)
;;
5)
stdout "Use ctrl-c to detach from the logs at any time"
(cd "${VRISING_COMPOSE_HOME}" && bash -c "docker-compose down -v && sleep 1 && docker-compose up -d && docker-compose logs -f")
(cd "${VRISING_COMPOSE_HOME}" && docker-compose down -v && sleep 1 && docker-compose up -d && docker-compose logs -f)
;;
*)
stderr "The provided input is not valid. Please chose from the listed actions"