From c47158ee8814584b0d1c4e632ba957e3f9f83d35 Mon Sep 17 00:00:00 2001 From: Davide Polonio Date: Thu, 25 May 2023 10:58:51 +0200 Subject: [PATCH] fix: explicitly ignore SIGINT signal --- vrising/src/vrising.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vrising/src/vrising.sh b/vrising/src/vrising.sh index 7d7a729..9806969 100755 --- a/vrising/src/vrising.sh +++ b/vrising/src/vrising.sh @@ -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"