fix(wrapper.sh): Drop the .sh extension

This commit is contained in:
Michael Carlberg 2016-06-11 07:44:46 +02:00
parent 2c74cb06de
commit b5a0da1457
4 changed files with 21 additions and 20 deletions

View File

@ -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}"

17
scripts/lemonbuddy_terminate Executable file
View File

@ -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

View File

@ -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
}