1 Commits

16
rsm
View File

@@ -9,7 +9,7 @@
# Date: August 29, 2018 # Date: August 29, 2018
# License: MIT # License: MIT
RSM_VERSION='v1.4.3' RSM_VERSION='v1.4.4'
export SVDIR=${SVDIR:-/run/runit/service/} export SVDIR=${SVDIR:-/run/runit/service/}
export LOGDIR="/var/log/" export LOGDIR="/var/log/"
@@ -502,7 +502,6 @@ do_enable_disable() {
# show logs # show logs
do_show_logs() { do_show_logs() {
monitors_array=($(xrandr -q))
local cmd=$1 local cmd=$1
local svc local svc
local ret=0 local ret=0
@@ -520,6 +519,8 @@ do_show_logs() {
fi fi
done done
if [[ -f "${RSVDIR}${cmd}" ]]; then
if ! [[ -d ${RSVDIR}${cmd} ]]; then if ! [[ -d ${RSVDIR}${cmd} ]]; then
printf "\n%20s\n" "${colorgreen}The following log files found:" printf "\n%20s\n" "${colorgreen}The following log files found:"
local logs_files_array=($(ls /var/log/$cmd/*.*)) local logs_files_array=($(ls /var/log/$cmd/*.*))
@@ -537,6 +538,11 @@ do_show_logs() {
tail -n 10 ${LOGDIR}${cmd}/*.* | more tail -n 10 ${LOGDIR}${cmd}/*.* | more
printf "\n" printf "\n"
fi fi
fi
if ! [[ -f "${RSVDIR}${cmd}" ]]; then
printf "\n%20s\n" "${colorred}The service's ${cmd} log files have not been found or do not exist"
fi
rmsg "$ret" "[$progname $cmd $*], exit code: $ret" rmsg "$ret" "[$progname $cmd $*], exit code: $ret"
return "$ret" return "$ret"
@@ -561,6 +567,7 @@ do_show_err_logs() {
fi fi
done done
if [[ -f "${RSVDIR}${cmd}" ]]; then
if ! [[ -d ${RSVDIR}${cmd} ]]; then if ! [[ -d ${RSVDIR}${cmd} ]]; then
printf "\n%20s\n" "${colorred}The following error log files found:" printf "\n%20s\n" "${colorred}The following error log files found:"
local logs_files_array=($(ls /var/log/$cmd/*error*.*)) local logs_files_array=($(ls /var/log/$cmd/*error*.*))
@@ -578,6 +585,11 @@ do_show_err_logs() {
tail -n 10 ${LOGDIR}${cmd}/*error*.* | more tail -n 10 ${LOGDIR}${cmd}/*error*.* | more
printf "\n" printf "\n"
fi fi
fi
if ! [[ -f "${RSVDIR}${cmd}" ]]; then
printf "\n%20s\n" "${colorred}The service's ${cmd} error log files have not been found or do not exist"
fi
rmsg "$ret" "[$progname $cmd $*], exit code: $ret" rmsg "$ret" "[$progname $cmd $*], exit code: $ret"
return "$ret" return "$ret"