Browse Source

more ui stuff

pull/3288/head
Daniel Gibbs 5 years ago
parent
commit
17d1122cce
  1. 6
      lgsm/functions/command_send.sh
  2. 9
      lgsm/functions/core_messages.sh

6
lgsm/functions/command_send.sh

@ -5,12 +5,15 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Send command to the server tmux console. # Description: Send command to the server tmux console.
commandname="SEND"
commandaction="Send"
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
check.sh check.sh
if [ -z "${userinput2}" ]; then if [ -z "${userinput2}" ]; then
fn_print_header fn_print_header
fn_print_information_nl "Send a command to to the console." fn_print_information_nl "Send a command to the console."
fi fi
check_status.sh check_status.sh
@ -21,6 +24,7 @@ if [ "${status}" != "0" ]; then
echo "" echo ""
commandtosend=$( fn_prompt_message "send: " ) commandtosend=$( fn_prompt_message "send: " )
fi fi
echo ""
fn_print_dots "Sending command to console: \"${commandtosend}\"" fn_print_dots "Sending command to console: \"${commandtosend}\""
tmux send-keys -t "${servicename}" "${commandtosend}" ENTER tmux send-keys -t "${servicename}" "${commandtosend}" ENTER
fn_print_ok_nl "Sending command to console: \"${commandtosend}\"" fn_print_ok_nl "Sending command to console: \"${commandtosend}\""

9
lgsm/functions/core_messages.sh

@ -361,13 +361,12 @@ fn_prompt_yn(){
# Prompt for message # Prompt for message
fn_prompt_message(){ fn_prompt_message(){
local prompt="$1"
while true; do while true; do
unset prompt
local prompt="$1"
read -e -p "${prompt}" -r answer read -e -p "${prompt}" -r answer
echo -e "${answer}" if fn_prompt_yn "Continue" Y; then
if ! fn_prompt_yn "Continue?" Y; then break;
exitcode=0
core_exit.sh
fi fi
done done
echo "${answer}" echo "${answer}"

Loading…
Cancel
Save