From b5a0da1457c92e0681c03c3cda27348437a69900 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Sat, 11 Jun 2016 07:44:46 +0200 Subject: [PATCH] fix(wrapper.sh): Drop the .sh extension --- CMakeLists.txt | 7 ++++--- scripts/lemonbuddy_terminate | 17 +++++++++++++++++ scripts/lemonbuddy_terminate.sh | 17 ----------------- ...lemonbuddy_wrapper.sh => lemonbuddy_wrapper} | 0 4 files changed, 21 insertions(+), 20 deletions(-) create mode 100755 scripts/lemonbuddy_terminate delete mode 100755 scripts/lemonbuddy_terminate.sh rename scripts/{lemonbuddy_wrapper.sh => lemonbuddy_wrapper} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a71166bb..22a2b250 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,9 +161,10 @@ configure_file("${CMAKE_SOURCE_DIR}/include/config.hpp.cmake" "${CMAKE_SOURCE_DI install(TARGETS ${PROJECT_NAME} DESTINATION "bin" COMPONENT "binaries") -install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/lemonbuddy_wrapper.sh" - DESTINATION "bin" - COMPONENT "binaries") +install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/lemonbuddy_wrapper" + DESTINATION "bin" COMPONENT "binaries") +install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/lemonbuddy_terminate" + DESTINATION "bin" COMPONENT "binaries") install(FILES "examples/config" DESTINATION "share/examples/${PROJECT_NAME}" diff --git a/scripts/lemonbuddy_terminate b/scripts/lemonbuddy_terminate new file mode 100755 index 00000000..e0e8fc8e --- /dev/null +++ b/scripts/lemonbuddy_terminate @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +if [[ "$1" != "noconfirm" ]]; then + read -p "Send SIGKILL to terminate processes? [Y/n] " -r choice + + [[ "${choice^^}" == "Y" ]] || { + echo "Aborting..."; exit + } +fi + +pgrep -f "(lemonbuddy_wrapper|^lemonb(uddy|ar))" | xargs kill -9 >/dev/null 2>&1 + +if [[ $? -eq 0 ]]; then + echo "Kill signals successfully sent" +else + echo "Failed to send kill signal ($?)" +fi diff --git a/scripts/lemonbuddy_terminate.sh b/scripts/lemonbuddy_terminate.sh deleted file mode 100755 index 16b067ac..00000000 --- a/scripts/lemonbuddy_terminate.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -read -p "Send SIGKILL to terminate processes? [Y/n] " -r choice - -[[ "${choice^^}" == "Y" ]] || { - echo "Aborting..." - exit -} - -[[ "${choice^^}" == "Y" ]] && { - pgrep -f "(lemonbuddy_wrapper.sh|^lemonb(uddy|ar))" | xargs kill -9 >/dev/null 2>&1 - - if [[ $? -eq 0 ]]; then - echo "Kill signals successfully sent" - else - echo "Failed to send kill signal ($?)" - fi -} diff --git a/scripts/lemonbuddy_wrapper.sh b/scripts/lemonbuddy_wrapper similarity index 100% rename from scripts/lemonbuddy_wrapper.sh rename to scripts/lemonbuddy_wrapper