Skip to content

Commit c847ecb

Browse files
authored
fix(messages): fix some messages not using newline correctly (#2765)
1 parent 80c4439 commit c847ecb

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

lgsm/functions/alert.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ elif [ "${postalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert
104104
fn_print_warn_nl "More Info not enabled"
105105
fn_script_log_warn "More Info alerts not enabled"
106106
elif [ -z "${posttarget}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
107-
fn_print_error_nl "posttarget not set"
107+
fn_print_error "posttarget not set"
108108
fn_script_error "posttarget not set"
109109
elif [ -z "${postdays}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
110-
fn_print_error_nl "postdays not set"
110+
fn_print_error "postdays not set"
111111
fn_script_error "postdays not set"
112112
fi
113113

@@ -117,7 +117,7 @@ elif [ "${discordalert}" != "on" ]&&[ "${function_selfname}" == "command_test_al
117117
fn_print_warn_nl "Discord alerts not enabled"
118118
fn_script_log_warn "Discord alerts not enabled"
119119
elif [ -z "${discordtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
120-
fn_print_error_nl "Discord token not set"
120+
fn_print_error "Discord token not set"
121121
echo -e " * https://docs.linuxgsm.com/alerts/discord"
122122
fn_script_error "Discord token not set"
123123
fi
@@ -128,7 +128,7 @@ elif [ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler
128128
fn_print_warn_nl "Email alerts not enabled"
129129
fn_script_log_warn "Email alerts not enabled"
130130
elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
131-
fn_print_error_nl "Email not set"
131+
fn_print_error "Email not set"
132132
fn_script_log_error "Email not set"
133133
fi
134134

@@ -138,7 +138,7 @@ elif [ "${iftttalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler
138138
fn_print_warn_nl "IFTTT alerts not enabled"
139139
fn_script_log_warn "IFTTT alerts not enabled"
140140
elif [ -z "${ifttttoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
141-
fn_print_error_nl "IFTTT token not set"
141+
fn_print_error "IFTTT token not set"
142142
echo -e " * https://docs.linuxgsm.com/alerts/ifttt"
143143
fn_script_error "IFTTT token not set"
144144
fi
@@ -149,7 +149,7 @@ elif [ "${mailgunalert}" != "on" ]&&[ "${function_selfname}" == "command_test_al
149149
fn_print_warn_nl "Mailgun alerts not enabled"
150150
fn_script_log_warn "Mailgun alerts not enabled"
151151
elif [ -z "${mailguntoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
152-
fn_print_error_nl "Mailgun token not set"
152+
fn_print_error "Mailgun token not set"
153153
echo -e " * https://docs.linuxgsm.com/alerts/mailgun"
154154
fn_script_error "Mailgun token not set"
155155
fi
@@ -160,7 +160,7 @@ elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test
160160
fn_print_warn_nl "Pushbullet alerts not enabled"
161161
fn_script_log_warn "Pushbullet alerts not enabled"
162162
elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
163-
fn_print_error_nl "Pushbullet token not set"
163+
fn_print_error "Pushbullet token not set"
164164
echo -e " * https://docs.linuxgsm.com/alerts/pushbullet"
165165
fn_script_error "Pushbullet token not set"
166166
fi
@@ -171,7 +171,7 @@ elif [ "${pushoveralert}" != "on" ]&&[ "${function_selfname}" == "command_test_a
171171
fn_print_warn_nl "Pushover alerts not enabled"
172172
fn_script_log_warn "Pushover alerts not enabled"
173173
elif [ -z "${pushovertoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
174-
fn_print_error_nl "Pushover token not set"
174+
fn_print_error "Pushover token not set"
175175
echo -e " * https://docs.linuxgsm.com/alerts/pushover"
176176
fn_script_error "Pushover token not set"
177177
fi
@@ -182,11 +182,11 @@ elif [ "${telegramalert}" != "on" ]&&[ "${function_selfname}" == "command_test_a
182182
fn_print_warn_nl "Telegram Messages not enabled"
183183
fn_script_log_warn "Telegram Messages not enabled"
184184
elif [ -z "${telegramtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
185-
fn_print_error_nl "Telegram token not set."
185+
fn_print_error "Telegram token not set."
186186
echo -e " * https://docs.linuxgsm.com/alerts/telegram"
187187
fn_script_error "Telegram token not set."
188188
elif [ -z "${telegramchatid}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
189-
fn_print_error_nl "Telegram chat id not set."
189+
fn_print_error "Telegram chat id not set."
190190
echo -e " * https://docs.linuxgsm.com/alerts/telegram"
191191
fn_script_error "Telegram chat id not set."
192192
fi
@@ -197,7 +197,7 @@ elif [ "${slackalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler
197197
fn_print_warn_nl "Slack alerts not enabled"
198198
fn_script_log_warn "Slack alerts not enabled"
199199
elif [ -z "${slacktoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
200-
fn_print_error_nl "Slack token not set"
200+
fn_print_error "Slack token not set"
201201
echo -e " * https://docs.linuxgsm.com/alerts/slack"
202202
fn_script_error "Slack token not set"
203203
fi

lgsm/functions/check_deps.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,11 @@ fn_found_missing_deps(){
273273
if [ "${steamcmdfail}" ]; then
274274
echo -e ""
275275
if [ "${function_selfname}" == "command_install.sh" ]; then
276-
fn_print_failure_nl "Missing dependencies required to run SteamCMD."
276+
fn_print_failure "Missing dependencies required to run SteamCMD."
277277
fn_script_log_fatal "Missing dependencies required to run SteamCMD."
278278
core_exit.sh
279279
else
280-
fn_print_error_nl "Missing dependencies required to run SteamCMD."
280+
fn_print_error "Missing dependencies required to run SteamCMD."
281281
fn_script_log_error "Missing dependencies required to run SteamCMD."
282282
fi
283283
fi
@@ -299,11 +299,11 @@ fn_found_missing_deps(){
299299
if [ "${steamcmdfail}" ]; then
300300
echo -e ""
301301
if [ "${function_selfname}" == "command_install.sh" ]; then
302-
fn_print_failure_nl "Missing dependencies required to run SteamCMD."
302+
fn_print_failure "Missing dependencies required to run SteamCMD."
303303
fn_script_log_fatal "Missing dependencies required to run SteamCMD."
304304
core_exit.sh
305305
else
306-
fn_print_error_nl "Missing dependencies required to run SteamCMD."
306+
fn_print_error "Missing dependencies required to run SteamCMD."
307307
fn_script_log_error "Missing dependencies required to run SteamCMD."
308308
fi
309309
fi

lgsm/functions/command_backup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ fn_backup_init(){
4343
info_distro.sh
4444
fn_print_dots "Backup starting"
4545
fn_script_log_info "Backup starting"
46-
fn_print_ok_nl "Backup starting"
46+
fn_print_ok "Backup starting"
4747
if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
48-
fn_print_info_nl "There are no previous backups"
48+
fn_print_info "There are no previous backups"
4949
else
5050
if [ "${lastbackupdaysago}" == "0" ]; then
5151
daysago="less than 1 day ago"

lgsm/functions/command_monitor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn_monitor_check_lockfile(){
2121
fn_print_error_eol_nl
2222
fn_script_log_error "Checking lockfile: No lockfile found: ERROR"
2323
fn_sleep_time
24-
echo -en "* Start ${selfname} to run monitor."
24+
echo -e "* Start ${selfname} to run monitor."
2525
core_exit.sh
2626
fi
2727

lgsm/functions/core_messages.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ fn_print_ok(){
149149

150150
fn_print_ok_nl(){
151151
if [ "${commandaction}" ]; then
152-
echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*"
152+
echo -e "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*"
153153
else
154-
echo -en "${creeol}[${green} OK ${default}] $*"
154+
echo -e "${creeol}[${green} OK ${default}] $*"
155155
fi
156156
fn_sleep_time
157157
echo -en "\n"
@@ -169,9 +169,9 @@ fn_print_fail(){
169169

170170
fn_print_fail_nl(){
171171
if [ "${commandaction}" ]; then
172-
echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*"
172+
echo -e "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*"
173173
else
174-
echo -en "${creeol}[${red} FAIL ${default}] $*"
174+
echo -e "${creeol}[${red} FAIL ${default}] $*"
175175
fi
176176
fn_sleep_time
177177
echo -en "\n"
@@ -189,9 +189,9 @@ fn_print_error(){
189189

190190
fn_print_error_nl(){
191191
if [ "${commandaction}" ]; then
192-
echo -en "${creeol}[${red}ERROR ${default}] ${commandaction} ${selfname}: $*"
192+
echo -e "${creeol}[${red}ERROR ${default}] ${commandaction} ${selfname}: $*"
193193
else
194-
echo -en "${creeol}[${red}ERROR ${default}] $*"
194+
echo -e "${creeol}[${red}ERROR ${default}] $*"
195195
fi
196196
fn_sleep_time
197197
echo -en "\n"
@@ -209,9 +209,9 @@ fn_print_warn(){
209209

210210
fn_print_warn_nl(){
211211
if [ "${commandaction}" ]; then
212-
echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*"
212+
echo -e "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*"
213213
else
214-
echo -en "${creeol}[${lightyellow} WARN ${default}] $*"
214+
echo -e "${creeol}[${lightyellow} WARN ${default}] $*"
215215
fi
216216
fn_sleep_time
217217
echo -en "\n"
@@ -229,9 +229,9 @@ fn_print_info(){
229229

230230
fn_print_info_nl(){
231231
if [ "${commandaction}" ]; then
232-
echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*"
232+
echo -e "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*"
233233
else
234-
echo -en "${creeol}[${cyan} INFO ${default}] $*"
234+
echo -e "${creeol}[${cyan} INFO ${default}] $*"
235235
fi
236236
fn_sleep_time
237237
echo -en "\n"

0 commit comments

Comments
 (0)