Skip to content

Commit 7059d9a

Browse files
authored
feat(linuxgsm): various ui improvements (#2554)
* added column to debug * added colour to header * colourised LinuxGSM header text * updated donate message * ascii logo * warn colour and altered header
1 parent 7a3fa84 commit 7059d9a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2031
-1988
lines changed

lgsm/config-default/config-lgsm/hwserver/_default.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ glibc="2.15"
145145
## Server Specific Directories
146146
systemdir="${serverfiles}"
147147
executabledir="${serverfiles}"
148-
executable=$([ "$(uname -m)" == "x86_64" ] && echo "./Hurtworld.x86_64" || echo "./Hurtworld.x86")
148+
executable=$([ "$(uname -m)" == "x86_64" ] && echo -e "./Hurtworld.x86_64" || echo -e "./Hurtworld.x86")
149149

150150
## Backup Directory
151151
backupdir="${lgsmdir}/backup"

lgsm/config-default/config-lgsm/qlserver/_default.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ glibc="2.15"
128128
## Server Specific Directories
129129
systemdir="${serverfiles}"
130130
executabledir="${serverfiles}"
131-
executable=$([ "$(uname -m)" == "x86_64" ] && echo "./run_server_x64.sh" || echo "./run_server_x86.sh")
131+
executable=$([ "$(uname -m)" == "x86_64" ] && echo -e "./run_server_x64.sh" || echo -e "./run_server_x86.sh")
132132
servercfg="${servicename}.cfg"
133133
servercfgdefault="server.cfg"
134134
servercfgdir="${serverfiles}/baseq3"

lgsm/config-default/config-lgsm/sdtdserver/_default.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ glibc="2.15"
129129
## Server Specific Directories
130130
systemdir="${serverfiles}"
131131
executabledir="${serverfiles}"
132-
executable=$([ "$(uname -m)" == "x86_64" ] && echo "./7DaysToDieServer.x86_64" || echo "./7DaysToDieServer.x86")
132+
executable=$([ "$(uname -m)" == "x86_64" ] && echo -e "./7DaysToDieServer.x86_64" || echo -e "./7DaysToDieServer.x86")
133133
servercfgdefault="serverconfig.xml"
134134
servercfgdirdefault="${serverfiles}"
135135
servercfgfullpathdefault="${servercfgdirdefault}/${servercfgdefault}"

lgsm/functions/alert.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ elif [ "${discordalert}" != "on" ]&&[ "${function_selfname}" == "command_test_al
118118
fn_script_log_warn "Discord alerts not enabled"
119119
elif [ -z "${discordtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
120120
fn_print_error_nl "Discord token not set"
121-
echo " * https://docs.linuxgsm.com/alerts/discord"
121+
echo -e " * https://docs.linuxgsm.com/alerts/discord"
122122
fn_script_error "Discord token not set"
123123
fi
124124

@@ -139,7 +139,7 @@ elif [ "${iftttalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler
139139
fn_script_log_warn "IFTTT alerts not enabled"
140140
elif [ -z "${ifttttoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
141141
fn_print_error_nl "IFTTT token not set"
142-
echo " * https://docs.linuxgsm.com/alerts/ifttt"
142+
echo -e " * https://docs.linuxgsm.com/alerts/ifttt"
143143
fn_script_error "IFTTT token not set"
144144
fi
145145

@@ -150,7 +150,7 @@ elif [ "${mailgunalert}" != "on" ]&&[ "${function_selfname}" == "command_test_al
150150
fn_script_log_warn "Mailgun alerts not enabled"
151151
elif [ -z "${mailguntoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
152152
fn_print_error_nl "Mailgun token not set"
153-
echo " * https://docs.linuxgsm.com/alerts/mailgun"
153+
echo -e " * https://docs.linuxgsm.com/alerts/mailgun"
154154
fn_script_error "Mailgun token not set"
155155
fi
156156

@@ -161,7 +161,7 @@ elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test
161161
fn_script_log_warn "Pushbullet alerts not enabled"
162162
elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
163163
fn_print_error_nl "Pushbullet token not set"
164-
echo " * https://docs.linuxgsm.com/alerts/pushbullet"
164+
echo -e " * https://docs.linuxgsm.com/alerts/pushbullet"
165165
fn_script_error "Pushbullet token not set"
166166
fi
167167

@@ -172,7 +172,7 @@ elif [ "${pushoveralert}" != "on" ]&&[ "${function_selfname}" == "command_test_a
172172
fn_script_log_warn "Pushover alerts not enabled"
173173
elif [ -z "${pushovertoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
174174
fn_print_error_nl "Pushover token not set"
175-
echo " * https://docs.linuxgsm.com/alerts/pushover"
175+
echo -e " * https://docs.linuxgsm.com/alerts/pushover"
176176
fn_script_error "Pushover token not set"
177177
fi
178178

@@ -183,11 +183,11 @@ elif [ "${telegramalert}" != "on" ]&&[ "${function_selfname}" == "command_test_a
183183
fn_script_log_warn "Telegram Messages not enabled"
184184
elif [ -z "${telegramtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
185185
fn_print_error_nl "Telegram token not set."
186-
echo " * https://docs.linuxgsm.com/alerts/telegram"
186+
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
189189
fn_print_error_nl "Telegram chat id not set."
190-
echo " * https://docs.linuxgsm.com/alerts/telegram"
190+
echo -e " * https://docs.linuxgsm.com/alerts/telegram"
191191
fn_script_error "Telegram chat id not set."
192192
fi
193193

@@ -198,6 +198,6 @@ elif [ "${slackalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler
198198
fn_script_log_warn "Slack alerts not enabled"
199199
elif [ -z "${slacktoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
200200
fn_print_error_nl "Slack token not set"
201-
echo " * https://docs.linuxgsm.com/alerts/slack"
201+
echo -e " * https://docs.linuxgsm.com/alerts/slack"
202202
fn_script_error "Slack token not set"
203203
fi

lgsm/functions/check_config.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if [ ! -e "${servercfgfullpath}" ]; then
1111
if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then
1212
fn_print_dots ""
1313
fn_print_warn_nl "Configuration file missing!"
14-
echo "${servercfgfullpath}"
14+
echo -e "${servercfgfullpath}"
1515
fn_script_log_warn "Configuration file missing!"
1616
fn_script_log_warn "${servercfgfullpath}"
1717
install_config.sh
@@ -22,14 +22,14 @@ if [ "${shortname}" == "rust" ]; then
2222
if [ -z "${rconpassword}" ]; then
2323
fn_print_dots ""
2424
fn_print_fail_nl "RCON password is not set!"
25-
echo " * Not setting an RCON password causes issues with ${gamename}"
25+
echo -e " * Not setting an RCON password causes issues with ${gamename}"
2626
fn_script_log_fatal "RCON password is not set"
2727
fn_script_log_fatal "Not setting an RCON password causes issues with ${gamename}"
2828
core_exit.sh
2929
elif [ "${rconpassword}" == "CHANGE_ME" ]; then
3030
fn_print_dots ""
3131
fn_print_warn_nl "Default RCON Password detected!"
32-
echo " * Having ${rconpassword} as a password is not very safe."
32+
echo -e " * Having ${rconpassword} as a password is not very safe."
3333
fn_script_log_warn "Default RCON Password detected"
3434
fi
3535
fi

lgsm/functions/check_deps.sh

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ fn_install_mono_repo(){
3636
eval ${cmd}
3737
else
3838
fn_print_warn_nl "Installing Mono repository"
39-
echo "Mono auto install not available for ${distroname}"
40-
echo " Follow instructions on mono site to install the latest version of Mono."
41-
echo " https://www.mono-project.com/download/stable/#download-lin"
39+
echo -e "Mono auto install not available for ${distroname}"
40+
echo -e " Follow instructions on mono site to install the latest version of Mono."
41+
echo -e " https://www.mono-project.com/download/stable/#download-lin"
4242
monoautoinstall="1"
4343
fi
4444
elif [ "${distroid}" == "debian" ]; then
@@ -52,9 +52,9 @@ fn_install_mono_repo(){
5252
cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https;echo 'deb https://download.mono-project.com/repo/debian stable-jessie main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
5353
eval ${cmd}
5454
else
55-
echo "Mono auto install not available for ${distroname}"
56-
echo " Follow instructions on mono site to install the latest version of Mono."
57-
echo " https://www.mono-project.com/download/stable/#download-lin"
55+
echo -e "Mono auto install not available for ${distroname}"
56+
echo -e " Follow instructions on mono site to install the latest version of Mono."
57+
echo -e " https://www.mono-project.com/download/stable/#download-lin"
5858
monoautoinstall="1"
5959
fi
6060
elif [ "${distroid}" == "centos" ]; then
@@ -68,18 +68,18 @@ fn_install_mono_repo(){
6868
cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos6-stable.repo | tee /etc/yum.repos.d/mono-centos6-stable.repo'"
6969
eval ${cmd}
7070
else
71-
echo "Mono auto install not available for ${distroname}"
72-
echo " Follow instructions on mono site to install the latest version of Mono."
73-
echo " https://www.mono-project.com/download/stable/#download-lin"
71+
echo -e "Mono auto install not available for ${distroname}"
72+
echo -e " Follow instructions on mono site to install the latest version of Mono."
73+
echo -e " https://www.mono-project.com/download/stable/#download-lin"
7474
monoautoinstall="1"
7575
fi
7676
elif [ "${distroid}" == "fedora" ]; then
7777
cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF'; su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'; dnf update"
7878
eval ${cmd}
7979
else
80-
echo "Mono auto install not available for ${distroname}"
81-
echo " Follow instructions on mono site to install the latest version of Mono."
82-
echo " https://www.mono-project.com/download/stable/#download-lin"
80+
echo -e "Mono auto install not available for ${distroname}"
81+
echo -e " Follow instructions on mono site to install the latest version of Mono."
82+
echo -e " https://www.mono-project.com/download/stable/#download-lin"
8383
monoautoinstall="1"
8484
fi
8585
if [ "${monoautoinstall}" != "1" ];then
@@ -95,11 +95,11 @@ fn_install_mono_repo(){
9595
fi
9696
else
9797
fn_print_information_nl "Installing Mono repository"
98-
echo ""
98+
echo -e ""
9999
fn_print_warning_nl "$(whoami) does not have sudo access. Manually install Mono repository."
100100
fn_script_log_warn "$(whoami) does not have sudo access. Manually install Mono repository."
101-
echo " Follow instructions on mono site to install the latest version of Mono."
102-
echo " https://www.mono-project.com/download/stable/#download-lin"
101+
echo -e " Follow instructions on mono site to install the latest version of Mono."
102+
echo -e " https://www.mono-project.com/download/stable/#download-lin"
103103
fi
104104
fi
105105
}
@@ -134,8 +134,8 @@ fn_install_universe_repo(){
134134
else
135135
fn_print_warning_nl "$(whoami) does not have sudo access. Manually add Universe repository."
136136
fn_script_log_warn "$(whoami) does not have sudo access. Manually add Universe repository."
137-
echo " Please run the following command as a user with sudo access, and re-run the installation"
138-
echo " sudo apt-add-repository universe"
137+
echo -e " Please run the following command as a user with sudo access, and re-run the installation"
138+
echo -e " sudo apt-add-repository universe"
139139
fi
140140
fi
141141
}
@@ -238,7 +238,7 @@ fn_found_missing_deps(){
238238
fi
239239
if [ -n "${jqstatus}" ]; then
240240
fn_print_warning_nl "jq is not available in the ${distroname} repository"
241-
echo " * https://docs.linuxgsm.com/requirements/jq"
241+
echo -e " * https://docs.linuxgsm.com/requirements/jq"
242242
fi
243243
if [ "${autoinstall}" == "1" ]; then
244244
sudo -n true > /dev/null 2>&1
@@ -268,18 +268,18 @@ fn_found_missing_deps(){
268268
if [ $? != 0 ]; then
269269
fn_print_failure_nl "Unable to install dependencies"
270270
fn_script_log_fatal "Unable to install dependencies"
271-
echo ""
271+
echo -e ""
272272
fn_print_warning_nl "Manually install dependencies."
273273
fn_script_log_warn "Manually install dependencies."
274274
if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
275-
echo " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}"
275+
echo -e " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}"
276276
elif [ -n "$(command -v dnf 2>/dev/null)" ]; then
277-
echo " sudo dnf install ${array_deps_missing[@]}"
277+
echo -e " sudo dnf install ${array_deps_missing[@]}"
278278
elif [ -n "$(command -v yum 2>/dev/null)" ]; then
279-
echo " sudo yum install ${array_deps_missing[@]}"
279+
echo -e " sudo yum install ${array_deps_missing[@]}"
280280
fi
281281
if [ "${steamcmdfail}" ]; then
282-
echo ""
282+
echo -e ""
283283
fn_print_failure_nl "Missing dependencies required to run SteamCMD."
284284
fn_script_log_fatal "Missing dependencies required to run SteamCMD."
285285
core_exit.sh
@@ -289,23 +289,23 @@ fn_found_missing_deps(){
289289
fn_script_log_pass "Install dependencies completed"
290290
fi
291291
else
292-
echo ""
292+
echo -e ""
293293
fn_print_warning_nl "$(whoami) does not have sudo access. Manually install dependencies."
294294
fn_script_log_warn "$(whoami) does not have sudo access. Manually install dependencies."
295295
if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
296-
echo " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}"
296+
echo -e " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}"
297297
elif [ -n "$(command -v dnf 2>/dev/null)" ]; then
298-
echo " sudo dnf install ${array_deps_missing[@]}"
298+
echo -e " sudo dnf install ${array_deps_missing[@]}"
299299
elif [ -n "$(command -v yum 2>/dev/null)" ]; then
300-
echo " sudo yum install ${array_deps_missing[@]}"
300+
echo -e " sudo yum install ${array_deps_missing[@]}"
301301
fi
302302
if [ "${steamcmdfail}" ]; then
303-
echo ""
303+
echo -e ""
304304
fn_print_failure_nl "Missing dependencies required to run SteamCMD."
305305
fn_script_log_fatal "Missing dependencies required to run SteamCMD."
306306
core_exit.sh
307307
fi
308-
echo ""
308+
echo -e ""
309309
fi
310310
if [ "${function_selfname}" == "command_install.sh" ]; then
311311
sleep 5
@@ -562,16 +562,16 @@ fn_deps_build_redhat(){
562562

563563
if [ "${function_selfname}" == "command_install.sh" ]; then
564564
if [ "$(whoami)" == "root" ]; then
565-
echo ""
566-
echo "Checking Dependencies as root"
567-
echo "================================="
565+
echo -e ""
566+
echo -e "${lightyellow}Checking Dependencies as root${default}"
567+
echo -e "================================="
568568
fn_print_information_nl "Checking any missing dependencies for ${gamename} server only."
569569
fn_print_information_nl "This will NOT install a ${gamename} server."
570570
fn_sleep_time
571571
else
572-
echo ""
573-
echo "Checking Dependencies"
574-
echo "================================="
572+
echo -e ""
573+
echo -e "${lightyellow}Checking Dependencies${default}"
574+
echo -e "================================="
575575
fi
576576
fi
577577

lgsm/functions/check_executable.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
1010
# Check if executable exists
1111
if [ ! -f "${executabledir}/${execname}" ]; then
1212
fn_print_fail_nl "executable was not found"
13-
echo "* ${executabledir}/${execname}"
13+
echo -e "* ${executabledir}/${execname}"
1414
if [ -d "${lgsmlogdir}" ]; then
1515
fn_script_log_fatal "Executable was not found: ${executabledir}/${execname}"
1616
fi

lgsm/functions/check_permissions.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn_check_ownership(){
4141
fi
4242

4343
} | column -s $'\t' -t | tee -a "${lgsmlog}"
44-
echo ""
44+
echo -e ""
4545
fn_print_information_nl "please see https://docs.linuxgsm.com/support/faq#fail-starting-game-server-permission-issues-found"
4646
fn_script_log "For more information, please see https://docs.linuxgsm.com/support/faq#fail-starting-game-server-permission-issues-found"
4747
if [ "${monitorflag}" == 1 ]; then
@@ -164,12 +164,12 @@ fn_sys_perm_errors_detect(){
164164

165165
# Display a message on how to fix the issue manually.
166166
fn_sys_perm_fix_manually_msg(){
167-
echo ""
167+
echo -e ""
168168
fn_print_information_nl "This error causes servers to fail starting properly"
169169
fn_script_log_info "This error causes servers to fail starting properly."
170-
echo " * To fix this issue, run the following command as root:"
170+
echo -e " * To fix this issue, run the following command as root:"
171171
fn_script_log_info "To fix this issue, run the following command as root:"
172-
echo " chmod a+rx /sys /sys/class /sys/class/net"
172+
echo -e " chmod a+rx /sys /sys/class /sys/class/net"
173173
fn_script_log "chmod a+rx /sys /sys/class /sys/class/net"
174174
fn_sleep_time
175175
if [ "${monitorflag}" == 1 ]; then

lgsm/functions/check_steamcmd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn_check_steamcmd_user(){
2323
else
2424
fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}"
2525
fi
26-
echo " * Change steamuser=\"username\" to a valid steam login."
26+
echo -e " * Change steamuser=\"username\" to a valid steam login."
2727
if [ -d "${lgsmlogdir}" ]; then
2828
if [ "${legacymode}" == "1" ]; then
2929
fn_script_log_fatal "Steam login not set. Update steamuser in ${selfname}"

lgsm/functions/check_tmuxception.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ fn_check_is_in_tmux(){
1212
fn_print_fail_nl "tmuxception error: Sorry Cobb you cannot start a tmux session inside of a tmux session."
1313
fn_script_log_fatal "Tmuxception error: Attempted to start a tmux session inside of a tmux session."
1414
fn_print_information_nl "LinuxGSM creates a tmux session when starting the server."
15-
echo "It is not possible to run a tmux session inside another tmux session"
16-
echo "https://docs.linuxgsm.com/requirements/tmux#tmuxception"
15+
echo -e "It is not possible to run a tmux session inside another tmux session"
16+
echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception"
1717
core_exit.sh
1818
fi
1919
}
@@ -23,8 +23,8 @@ fn_check_is_in_screen(){
2323
fn_print_fail_nl "tmuxception error: Sorry Cobb you cannot start a tmux session inside of a screen session."
2424
fn_script_log_fatal "Tmuxception error: Attempted to start a tmux session inside of a screen session."
2525
fn_print_information_nl "LinuxGSM creates a tmux session when starting the server."
26-
echo "It is not possible to run a tmux session inside screen session"
27-
echo "https://docs.linuxgsm.com/requirements/tmux#tmuxception"
26+
echo -e "It is not possible to run a tmux session inside screen session"
27+
echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception"
2828
core_exit.sh
2929
fi
3030
}

0 commit comments

Comments
 (0)