Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
0506889700
|
|||
59d2325f73
|
70
rsm
70
rsm
@@ -9,7 +9,7 @@
|
|||||||
# Date: August 29, 2018
|
# Date: August 29, 2018
|
||||||
# License: MIT
|
# License: MIT
|
||||||
|
|
||||||
RSM_VERSION='v1.4.2'
|
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/"
|
||||||
@@ -476,6 +476,7 @@ do_enable_disable() {
|
|||||||
ret=1
|
ret=1
|
||||||
else
|
else
|
||||||
ln -s ${FLDIR}${svc} ${SVDIR}
|
ln -s ${FLDIR}${svc} ${SVDIR}
|
||||||
|
do_status
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
disable)
|
disable)
|
||||||
@@ -485,6 +486,7 @@ do_enable_disable() {
|
|||||||
ret=1
|
ret=1
|
||||||
else
|
else
|
||||||
unlink ${SVDIR}${svc}
|
unlink ${SVDIR}${svc}
|
||||||
|
do_status
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -500,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
|
||||||
@@ -518,22 +519,29 @@ do_show_logs() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if ! [[ -d ${RSVDIR}${cmd} ]]; then
|
|
||||||
printf "\n%20s\n" "${colorgreen}The following log files found:"
|
|
||||||
local logs_files_array=($(ls /var/log/$cmd/*.*))
|
|
||||||
printf "\n$colorblue"
|
|
||||||
printf '%s\n' "${logs_files_array[@]}"
|
|
||||||
|
|
||||||
printf "\n$colormagenta"
|
if [[ -f "${RSVDIR}${cmd}" ]]; then
|
||||||
read -n 1 -s -r -p "Press any key to continue"
|
if ! [[ -d ${RSVDIR}${cmd} ]]; then
|
||||||
|
printf "\n%20s\n" "${colorgreen}The following log files found:"
|
||||||
|
local logs_files_array=($(ls /var/log/$cmd/*.*))
|
||||||
|
printf "\n$colorblue"
|
||||||
|
printf '%s\n' "${logs_files_array[@]}"
|
||||||
|
|
||||||
printf "\n"
|
printf "\n$colormagenta"
|
||||||
printf "\n${colorcyan}Log files full output:\n"
|
read -n 1 -s -r -p "Press any key to continue"
|
||||||
printf "${coloryellow}\n"
|
|
||||||
printf "${coloryellow}${opt}"
|
|
||||||
|
|
||||||
tail -n 10 ${LOGDIR}${cmd}/*.* | more
|
printf "\n"
|
||||||
printf "\n"
|
printf "\n${colorcyan}Log files full output:\n"
|
||||||
|
printf "${coloryellow}\n"
|
||||||
|
printf "${coloryellow}${opt}"
|
||||||
|
|
||||||
|
tail -n 10 ${LOGDIR}${cmd}/*.* | more
|
||||||
|
printf "\n"
|
||||||
|
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
|
fi
|
||||||
|
|
||||||
rmsg "$ret" "[$progname $cmd $*], exit code: $ret"
|
rmsg "$ret" "[$progname $cmd $*], exit code: $ret"
|
||||||
@@ -559,22 +567,28 @@ do_show_err_logs() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if ! [[ -d ${RSVDIR}${cmd} ]]; then
|
if [[ -f "${RSVDIR}${cmd}" ]]; then
|
||||||
printf "\n%20s\n" "${colorred}The following error log files found:"
|
if ! [[ -d ${RSVDIR}${cmd} ]]; then
|
||||||
local logs_files_array=($(ls /var/log/$cmd/*error*.*))
|
printf "\n%20s\n" "${colorred}The following error log files found:"
|
||||||
printf "\n$colorblue"
|
local logs_files_array=($(ls /var/log/$cmd/*error*.*))
|
||||||
printf '%s\n' "${logs_files_array[@]}"
|
printf "\n$colorblue"
|
||||||
|
printf '%s\n' "${logs_files_array[@]}"
|
||||||
|
|
||||||
printf "\n$colormagenta"
|
printf "\n$colormagenta"
|
||||||
read -n 1 -s -r -p "Press any key to continue"
|
read -n 1 -s -r -p "Press any key to continue"
|
||||||
|
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "\n${colorcyan}Log files full output:\n"
|
printf "\n${colorcyan}Log files full output:\n"
|
||||||
printf "${coloryellow}\n"
|
printf "${coloryellow}\n"
|
||||||
printf "${coloryellow}${opt}"
|
printf "${coloryellow}${opt}"
|
||||||
|
|
||||||
tail -n 10 ${LOGDIR}${cmd}/*error*.* | more
|
tail -n 10 ${LOGDIR}${cmd}/*error*.* | more
|
||||||
printf "\n"
|
printf "\n"
|
||||||
|
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
|
fi
|
||||||
|
|
||||||
rmsg "$ret" "[$progname $cmd $*], exit code: $ret"
|
rmsg "$ret" "[$progname $cmd $*], exit code: $ret"
|
||||||
|
Reference in New Issue
Block a user