Browse Source

fix: update some servicename var's that did not get replaced with selfname

pull/2629/head
Daniel Gibbs 5 years ago
parent
commit
755c26eaf1
No known key found for this signature in database GPG Key ID: E50EE233189485E3
  1. 2
      lgsm/functions/alert.sh
  2. 24
      lgsm/functions/core_messages.sh
  3. 8
      linuxgsm.sh

2
lgsm/functions/alert.sh

@ -76,7 +76,7 @@ fn_alert_config(){
alertemoji="🎮" alertemoji="🎮"
alertsound="1" alertsound="1"
alerturl="not enabled" alerturl="not enabled"
alertbody="${servicename} has received a new _default.cfg. Check file for changes." alertbody="${selfname} has received a new _default.cfg. Check file for changes."
} }
if [ "${alert}" == "permissions" ]; then if [ "${alert}" == "permissions" ]; then

24
lgsm/functions/core_messages.sh

@ -119,7 +119,7 @@ fn_script_log_info(){
# [ .... ] # [ .... ]
fn_print_dots(){ fn_print_dots(){
if [ -n "${commandaction}" ]; then if [ -n "${commandaction}" ]; then
echo -en "${creeol}[ .... ] ${commandaction} ${servicename}: $*" echo -en "${creeol}[ .... ] ${commandaction} ${selfname}: $*"
else else
echo -en "${creeol}[ .... ] $*" echo -en "${creeol}[ .... ] $*"
fi fi
@ -128,7 +128,7 @@ fn_print_dots(){
fn_print_dots_nl(){ fn_print_dots_nl(){
if [ -n "${commandaction}" ]; then if [ -n "${commandaction}" ]; then
echo -e "${creeol}[ .... ] ${commandaction} ${servicename}: $*" echo -e "${creeol}[ .... ] ${commandaction} ${selfname}: $*"
else else
echo -e "${creeol}[ .... ] $*" echo -e "${creeol}[ .... ] $*"
fi fi
@ -139,7 +139,7 @@ fn_print_dots_nl(){
# [ OK ] # [ OK ]
fn_print_ok(){ fn_print_ok(){
if [ -n "${commandaction}" ]; then if [ -n "${commandaction}" ]; then
echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${servicename}: $*" echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*"
else else
echo -en "${creeol}[${green} OK ${default}] $*" echo -en "${creeol}[${green} OK ${default}] $*"
fi fi
@ -148,7 +148,7 @@ fn_print_ok(){
fn_print_ok_nl(){ fn_print_ok_nl(){
if [ -n "${commandaction}" ]; then if [ -n "${commandaction}" ]; then
echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${servicename}: $*" echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*"
else else
echo -en "${creeol}[${green} OK ${default}] $*" echo -en "${creeol}[${green} OK ${default}] $*"
fi fi
@ -159,7 +159,7 @@ fn_print_ok_nl(){
# [ FAIL ] # [ FAIL ]
fn_print_fail(){ fn_print_fail(){
if [ -n "${commandaction}" ]; then if [ -n "${commandaction}" ]; then
echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${servicename}: $*" echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*"
else else
echo -en "${creeol}[${red} FAIL ${default}] $*" echo -en "${creeol}[${red} FAIL ${default}] $*"
fi fi
@ -168,7 +168,7 @@ fn_print_fail(){
fn_print_fail_nl(){ fn_print_fail_nl(){
if [ -n "${commandaction}" ]; then if [ -n "${commandaction}" ]; then
echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${servicename}: $*" echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*"
else else
echo -en "${creeol}[${red} FAIL ${default}] $*" echo -en "${creeol}[${red} FAIL ${default}] $*"
fi fi
@ -179,7 +179,7 @@ fn_print_fail_nl(){
# [ ERROR ] # [ ERROR ]
fn_print_error(){ fn_print_error(){
if [ -n "${commandaction}" ]; then if [ -n "${commandaction}" ]; then
echo -en "${creeol}[${red}ERROR ${default}] ${commandaction} ${servicename}: $*" echo -en "${creeol}[${red}ERROR ${default}] ${commandaction} ${selfname}: $*"
else else
echo -en "${creeol}[${red}ERROR ${default}] $*" echo -en "${creeol}[${red}ERROR ${default}] $*"
fi fi
@ -188,7 +188,7 @@ fn_print_error(){
fn_print_error_nl(){ fn_print_error_nl(){
if [ -n "${commandaction}" ]; then if [ -n "${commandaction}" ]; then
echo -en "${creeol}[${red}ERROR ${default}] ${commandaction} ${servicename}: $*" echo -en "${creeol}[${red}ERROR ${default}] ${commandaction} ${selfname}: $*"
else else
echo -en "${creeol}[${red}ERROR ${default}] $*" echo -en "${creeol}[${red}ERROR ${default}] $*"
fi fi
@ -199,7 +199,7 @@ fn_print_error_nl(){
# [ WARN ] # [ WARN ]
fn_print_warn(){ fn_print_warn(){
if [ -n "${commandaction}" ]; then if [ -n "${commandaction}" ]; then
echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${servicename}: $*" echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*"
else else
echo -en "${creeol}[${lightyellow} WARN ${default}] $*" echo -en "${creeol}[${lightyellow} WARN ${default}] $*"
fi fi
@ -208,7 +208,7 @@ fn_print_warn(){
fn_print_warn_nl(){ fn_print_warn_nl(){
if [ -n "${commandaction}" ]; then if [ -n "${commandaction}" ]; then
echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${servicename}: $*" echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*"
else else
echo -en "${creeol}[${lightyellow} WARN ${default}] $*" echo -en "${creeol}[${lightyellow} WARN ${default}] $*"
fi fi
@ -219,7 +219,7 @@ fn_print_warn_nl(){
# [ INFO ] # [ INFO ]
fn_print_info(){ fn_print_info(){
if [ -n "${commandaction}" ]; then if [ -n "${commandaction}" ]; then
echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${servicename}: $*" echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*"
else else
echo -en "${creeol}[${cyan} INFO ${default}] $*" echo -en "${creeol}[${cyan} INFO ${default}] $*"
fi fi
@ -228,7 +228,7 @@ fn_print_info(){
fn_print_info_nl(){ fn_print_info_nl(){
if [ -n "${commandaction}" ]; then if [ -n "${commandaction}" ]; then
echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${servicename}: $*" echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*"
else else
echo -en "${creeol}[${cyan} INFO ${default}] $*" echo -en "${creeol}[${cyan} INFO ${default}] $*"
fi fi

8
linuxgsm.sh

@ -357,13 +357,13 @@ else
source "${configdirserver}/common.cfg" source "${configdirserver}/common.cfg"
fi fi
# Load the instance.cfg config. If missing download it. # Load the instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null # shellcheck source=/dev/null
source "${configdirserver}/${servicename}.cfg" source "${configdirserver}/${selfname}.cfg"
else else
# shellcheck source=/dev/null # shellcheck source=/dev/null
source "${configdirserver}/${servicename}.cfg" source "${configdirserver}/${selfname}.cfg"
fi fi
# Load the linuxgsm.sh in to tmpdir. If missing download it. # Load the linuxgsm.sh in to tmpdir. If missing download it.

Loading…
Cancel
Save