Browse Source

minor message updates

pull/1601/head
Daniel Gibbs 8 years ago
parent
commit
2b6bacad9b
  1. 10
      lgsm/functions/alert_email.sh
  2. 10
      lgsm/functions/alert_telegram.sh
  3. 2
      lgsm/functions/command_debug.sh
  4. 2
      lgsm/functions/command_details.sh

10
lgsm/functions/alert_email.sh

@ -34,7 +34,7 @@ fn_details_os(){
echo -e "Distro: ${distroname}"
echo -e "Arch: ${arch}"
echo -e "Kernel: ${kernel}"
echo -e "Hostname: $HOSTNAME"
echo -e "Hostname: ${HOSTNAME}"
echo -e "tmux: ${tmuxv}"
echo -e "GLIBC: ${glibcversion}"
} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1
@ -235,9 +235,9 @@ else
fi
exitcode=$?
if [ "${exitcode}" == "0" ]; then
fn_print_ok_nl "Sending alert: ${email}"
fn_script_log_pass "Sending alert: ${email}"
fn_print_ok_nl "Sending Email alert: ${email}"
fn_script_log_pass "Sending Email alert: ${email}"
else
fn_print_fail_nl "Sending alert: ${email}"
fn_script_log_fatal "Sending alert: ${email}"
fn_print_fail_nl "Sending Email alert: ${email}"
fn_script_log_fatal "Sending Email alert: ${email}"
fi

10
lgsm/functions/alert_telegram.sh

@ -21,12 +21,12 @@ EOF
fn_print_dots "Sending Telegram Alert"
sleep 0.5
telegramsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d """$json""" "https://api.telegram.org/bot${telegramtoken}/sendMessage" | grep -Po '(?<="description":").*?(?=")'|uniq)
telegramsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d """${json}""" "https://api.telegram.org/bot${telegramtoken}/sendMessage" | grep -Po '(?<="description":").*?(?=")'|uniq)
if [ -n "${telegramsend}" ]; then
fn_print_fail_nl "Sending Telegram Alert: ${telegramsend}"
fn_script_log_fatal "Sending Telegram Alert: ${telegramsend}"
fn_print_fail_nl "Sending Telegram alert: ${telegramsend}"
fn_script_log_fatal "Sending Telegram alert: ${telegramsend}"
else
fn_print_ok_nl "Sending Telegram Alert"
fn_script_log_pass "Sent Telegram Alert"
fn_print_ok_nl "Sending Telegram alert"
fn_script_log_pass "Sent Telegram alert"
fi

2
lgsm/functions/command_debug.sh

@ -29,7 +29,7 @@ fn_print_header
echo -e "${blue}Distro:\t${default}${distroname}"
echo -e "${blue}Arch:\t${default}${arch}"
echo -e "${blue}Kernel:\t${default}${kernel}"
echo -e "${blue}Hostname:\t${default}$HOSTNAME"
echo -e "${blue}Hostname:\t${default}${HOSTNAME}"
echo -e "${blue}tmux:\t${default}${tmuxv}"
echo -e "${blue}Avg Load:\t${default}${load}"
echo -e "${blue}Free Memory:\t${default}${physmemfree}"

2
lgsm/functions/command_details.sh

@ -30,7 +30,7 @@ fn_details_os(){
echo -e "${blue}Distro:\t${default}${distroname}"
echo -e "${blue}Arch:\t${default}${arch}"
echo -e "${blue}Kernel:\t${default}${kernel}"
echo -e "${blue}Hostname:\t${default}$HOSTNAME"
echo -e "${blue}Hostname:\t${default}${HOSTNAME}"
echo -e "${blue}tmux:\t${default}${tmuxv}"
echo -e "${blue}GLIBC:\t${default}${glibcversion}"
} | column -s $'\t' -t

Loading…
Cancel
Save