Skip to content
Permalink
Browse files

feat(refactor): general refactor of if statements (#2492)

* Codacy recommendation fixes
  • Loading branch information...
dgibbs64 committed Aug 30, 2019
1 parent c3521ba commit 1d41bc66d31deb70f133565b168d70187d72bf47
Showing with 189 additions and 203 deletions.
  1. +1 −1 .gitattributes
  2. +1 −1 .github/ISSUE_TEMPLATE/new-server-request.md
  3. +1 −1 .github/potential-duplicates.yml
  4. +2 −2 .github/request-info.yml
  5. +1 −1 .github/topissuebot.yml
  6. +1 −1 .github/welcome.yml
  7. +1 −1 .github/write-good.yml
  8. +1 −1 .gitignore
  9. +1 −1 CONTRIBUTING.md
  10. +0 −1 LICENSE
  11. +13 −13 README.md
  12. +1 −1 lgsm/functions/alert_email.sh
  13. +1 −1 lgsm/functions/check_deps.sh
  14. +3 −3 lgsm/functions/check_permissions.sh
  15. +0 −1 lgsm/functions/check_system_dir.sh
  16. +1 −1 lgsm/functions/command_dev_clear_functions.sh
  17. +1 −1 lgsm/functions/command_donate.sh
  18. +3 −3 lgsm/functions/command_fastdl.sh
  19. +2 −2 lgsm/functions/command_monitor.sh
  20. +1 −1 lgsm/functions/command_restart.sh
  21. +3 −3 lgsm/functions/command_start.sh
  22. +1 −1 lgsm/functions/command_update_functions.sh
  23. +2 −2 lgsm/functions/core_dl.sh
  24. +1 −1 lgsm/functions/core_trap.sh
  25. +1 −1 lgsm/functions/fix_ark.sh
  26. +1 −1 lgsm/functions/fix_arma3.sh
  27. +1 −1 lgsm/functions/fix_ges.sh
  28. +1 −1 lgsm/functions/fix_kf.sh
  29. +1 −1 lgsm/functions/fix_rw.sh
  30. +1 −1 lgsm/functions/fix_sdtd.sh
  31. +1 −1 lgsm/functions/fix_ut.sh
  32. +1 −1 lgsm/functions/fix_ut2k4.sh
  33. +2 −2 lgsm/functions/info_distro.sh
  34. +34 −34 lgsm/functions/info_messages.sh
  35. +90 −102 lgsm/functions/install_config.sh
  36. +1 −1 lgsm/functions/install_server_dir.sh
  37. +1 −1 lgsm/functions/install_server_files.sh
  38. +1 −1 lgsm/functions/install_squad_license.sh
  39. +2 −2 lgsm/functions/logs.sh
  40. +1 −1 lgsm/functions/mods_core.sh
  41. +1 −1 lgsm/functions/query_gamedig.sh
  42. +1 −1 linuxgsm.sh
  43. +1 −1 tests/tests_fctrserver.sh
  44. +1 −1 tests/tests_jc2server.sh
  45. +1 −1 tests/tests_mcserver.sh
  46. +1 −1 tests/tests_ts3server.sh
@@ -19,4 +19,4 @@
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.RTF diff=astextplain
@@ -26,4 +26,4 @@ If yes Use SteamDB to get the appid. (https://steamdb.info).
We only support Linux servers and do not support Wine.

* [ ] Yes
* [ ] No
* [ ] No
@@ -10,4 +10,4 @@ referenceComment: >
Potential duplicates:
{{#issues}}
- [#{{ number }}] {{ title }} ({{ accuracy }}%)
{{/issues}}
{{/issues}}
@@ -3,7 +3,7 @@
# *Required* Comment to reply with
requestInfoReplyComment: >
![More Data required](https://i.imgur.com/yS9cecv.png)
More data is required to assist with this issue
More data is required to assist with this issue
or issue template was not used correctly.
https://linuxgsm.com/support/#guide
@@ -14,4 +14,4 @@ requestInfoReplyComment: >
# - updates

# *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given
requestInfoLabelToAdd: "needs more info"
requestInfoLabelToAdd: "needs more info"
@@ -1,4 +1,4 @@
# Configuration for top-issue-bot
labelName: ":thumbsup: Top Issue!"
labelColor: "f442c2"
numberOfIssuesToLabel: 5
numberOfIssuesToLabel: 5
@@ -18,4 +18,4 @@ newPRWelcomeComment: >
firstPRMergeComment: >
Congratulations on merging your first pull request! Thank you for supporting LinuxGSM!
# It is recommend to include as many gifs and emojis as possible
# It is recommend to include as many gifs and emojis as possible
@@ -1,4 +1,4 @@
# .github/write-good.yml
writeGood: true
alex: true
spellchecker: true
spellchecker: true
@@ -1,2 +1,2 @@
*.db
.idea
.idea
@@ -33,4 +33,4 @@ This will help us in understanding your code and determining where problems may
Start reading our code and you'll get the hang of it. Explore how functions are organized and you'll see how we strive for readable code.

Please give the following document a read and adjust your code according to its specifications.
[Syntax & Coding Conventions](https://github.com/GameServerManagers/LinuxGSM/wiki/Syntax-and-Conventions)
[Syntax & Coding Conventions](https://github.com/GameServerManagers/LinuxGSM/wiki/Syntax-and-Conventions)
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@@ -2,10 +2,10 @@
<br>
<a href="https://linuxgsm.com"><img src="https://github.com/GameServerManagers/LinuxGSM-Docs/raw/master/.gitbook/assets/linuxgsm_colour_logo_workmark_short_384.png" alt="LinuxGSM"></a>
</h1>

[![LinuxGSM](https://img.shields.io/badge/-LinuxGSM-2b2b2b.svg?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAACsAAABACAYAAACDbo5ZAAAGD0lEQVR4AcWYa2wUVRvHz75c2vJ2disXoUBEVIioRAx%2BMIFA1IRwUS6KCCiIKBrvhEYiiGm5iBgk8QOGEgUUDYTttmVZWFr2UmwURS6iYAoCtmisElSsdHdbkT7%2BTzoNy%2BGc2dm54C%2F5Rdkz85x%2FZ86ZOXOYXYhIg3Phx%2FA4PAcv6f%2Btg5vhHJjP3EcZsgsshufJHH%2FAJbDztQ7aG35J1vgCXn%2BtgvrgEbLHYei9FmE3kDOUuh10OGwjZ7gEh7kZ9gNyllK3gnrg7%2BQs56DHjbCDyB0GuRF2ArnDeDfCziF3mO1G2FfJHRa4EXYpuUOxG2GXkzuUuBH2TXKH5W6ELSV3eM%2BNsOUk5yQcAY8p2uvgSPitor3MjbB1UOQXOFBvHwpbhPYWOExvL4SNUOQ7p4P2JTlzhOPmCu0vCu1PQpE2WOhk2MdJjk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TELOav7jY%2FqAvoXp0Gc9NX7bIZl17%2FZl0rC1wRLeno0NvP%2B0CTcYNnS8wW6CtzNANaxzKqo9hRNOQ8rGo7tmSsMe2zWdt2frqVRcm5s2fofCgawDNHRNxnyfqgsYez4y4ADCjRM9H73hsNWafILTQdaFiSTj%2BQ%2FxA6yH7d%2BCmR8XbYr0a7VTF2N4siSsb5qdos3R6%2FjGxpULFfw7EfORnbrI9TAToX0sD40%2F2ylcGdh2Rdhg%2BSf2gka9jRTqK9%2BGwgHz7RTfVbHxirDhivdthYUvMRX8aYAD9lstvi%2B0aDL2DUZ0eCBUNNVG0IP65FLTWqPdiqdC0koHTVXe7iyNRG23QotBEy1RbTAzQyrmnYUT2rLsoA13JpcB4eVC2daBM1g2JGLekmwf5On7EJfngfZTNnVSce8bFjaTmQdvs%2FXmO%2FJVpoXdx3RSUe9O00Fj3nUdy0RLgRHiHXOPGW1h2uKZ07c9rG%2Bxyefp23pQeyBIEQoavYlakrG8fnrY5yHn2fbxXzAgw7m8bT5zkkSk4C7cpmOK21esB%2FXAQ5DzFfTo43%2BF%2FDzf0eZ4wZ3MDSjMcvD6nIeOahGgia%2FyU3HforTPkWkwnakdn0cI9jqfbPjD%2FuQLJr6644snlgX%2FApOMoyd1R5%2FxAAAAAElFTkSuQmCC)](https://linuxgsm.com) [![Build Status](https://travis-ci.com/GameServerManagers/LinuxGSM.svg?branch=master)](https://travis-ci.com/GameServerManagers/LinuxGSM) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/3e98be27840043a090c3ab6e35db44b0)](https://app.codacy.com/app/GameServerManagers/LinuxGSM?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Grade_Dashboard) [![Discord](https://discordapp.com/api/guilds/127498813903601664/widget.png?style=shield)](https://linuxgsm.com/discord) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE) [![made-with-bash](https://img.shields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8piH6HeA4fPbpdBQV5KOx0QaL1YppX3Jgk0TwH2Vg6S3u%2BdB91%2B%2FpuNYPYFl5uP5V7ZqvsrX7jxqMXR6ff3gCQSTzFI0a1TX3wIs8ul%2Bq4HuWAAiM39vhOuR1O1fQ2gT%2F26Z8Z5vrl2OHi9OXZn995nLV9aFfS6UC9JeJPfuK0NBohWpCHMSAAsFe74WWP%2BvT25wtP9Bpob6uGqqyDnOtaeumjRu%2ByFu36VntK%2FPA5umTJeUtPWZSU9BCgud661odVp3DZtkc7AnYR33RRC708PrVi1larW7XwZIjLnd7R6SgSqWSNjU1B3F72pz5TZbXmX5vV81Yb7Lg7XT%2FUXriu8XLVqw6c6XqWnBKiiYU%2BMt3wWF7u7i91XlSEITwSAZ%2FCzAAHsJVbwXYFFEAAAAASUVORK5CYII%3D)](https://www.gnu.org/software/bash/) [![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors)
[LinuxGSM](https://linuxgsm.com) is the command line tool for quick, simple deployment and management of dedicated game servers.

[LinuxGSM](https://linuxgsm.com) is the command line tool for quick, simple deployment and management of dedicated game servers.

## Hassle-Free Dedicated Game Servers

@@ -15,22 +15,22 @@ Traditionally game servers are not easy to manage yourself. Admins often have to

80+ game servers supported

* :truck: Installer
* :mag: Monitor
* :phone: Alerts
* :cloud: Updater
* :blue_book: Server Details
* :floppy_disk: Backup
* :truck: Installer
* :mag: Monitor
* :phone: Alerts
* :cloud: Updater
* :blue_book: Server Details
* :floppy_disk: Backup
* :computer: Console

## :penguin: Compatibility
## :penguin: Compatibility

Linux Game Server Managers are tested to work on the following Linux distros.

* Debian based (Ubuntu, Mint etc.)
* Red Hat based (CentOS, Fedora etc.)

Other distros are likely to work but are not fully tested.
Other distros are likely to work but are not fully tested.

## :wrench: Requirements

@@ -41,7 +41,7 @@ Each game server has its own specific dependency requirements, but most require

## :blue_book: Documentation

Documentation is found at [linuxgsm.com](https://linuxgsm.com) and [docs.linuxgsm.com](https://docs.linuxgsm.com)
Documentation is found at [linuxgsm.com](https://linuxgsm.com) and [docs.linuxgsm.com](https://docs.linuxgsm.com)

## :question: Support

@@ -61,4 +61,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
@@ -23,4 +23,4 @@ if [ "${exitcode}" == "0" ]; then
else
fn_print_fail_nl "Sending Email alert: ${email}"
fn_script_log_fatal "Sending Email alert: ${email}"
fi
fi
@@ -120,7 +120,7 @@ fn_install_universe_repo(){
sleep 1
echo -en " \r"
cmd="sudo apt-add-repository universe"
eval ${cmd}
eval "${cmd}"
if [ $? -eq 0 ]; then
fn_print_complete_nl "Installing universe repository completed."
fn_script_log_pass "Installing universe repository completed."
@@ -9,17 +9,17 @@ local commandname="CHECK"

fn_check_ownership(){
if [ -f "${rootdir}/${selfname}" ]; then
if [ "$(find "${rootdir}/${selfname}" -not -user $(whoami) | wc -l)" -ne "0" ]; then
if [ "$(find "${rootdir}/${selfname}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then
selfownissue=1
fi
fi
if [ -d "${functionsdir}" ]; then
if [ "$(find "${functionsdir}" -not -user $(whoami) | wc -l)" -ne "0" ]; then
if [ "$(find "${functionsdir}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then
funcownissue=1
fi
fi
if [ -d "${serverfiles}" ]; then
if [ "$(find "${serverfiles}" -not -user $(whoami) | wc -l)" -ne "0" ]; then
if [ "$(find "${serverfiles}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then
filesownissue=1
fi
fi
@@ -20,4 +20,3 @@ if [ ! -d "${checkdir}" ]; then
fi
core_exit.sh
fi

@@ -12,4 +12,4 @@ if fn_prompt_yn "Do you want to delete all functions?" Y; then
rm -rfv "${functionsdir:?}/"*
rm -rfv "${configdirdefault:?}/"*
fi
core_exit.sh
core_exit.sh
@@ -15,4 +15,4 @@ echo -e "* ${blue}Patreon:${default} https://linuxgsm.com/patreon"
echo -e "* ${blue}PayPal:${default} https://linuxgsm.com/paypal"
echo -e "* ${blue}Flattr:${default} https://linuxgsm.com/flattr"
echo -e ""
echo -e "LinuxGSM has been going since 2012"
echo -e "LinuxGSM has been going since 2012"
@@ -196,7 +196,7 @@ fn_fastdl_preview(){
echo "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt"
done < <(find "${systemdir}/${directory}" -type f -iname ${allowed_extention})
tput rc; tput el
printf "gathering ${directory} ${allowed_extention} : ${fileswc}..."
echo "gathering ${directory} ${allowed_extention} : ${fileswc}..."
if [ ${fileswc} != 0 ]; then
fn_print_ok_eol_nl
else
@@ -245,7 +245,7 @@ fn_fastdl_gmod(){
while read -r fastdlfile; do
((fileswc++))
tput rc; tput el
printf "copying ${allowed_extention} : ${fileswc}..."
echo "copying ${allowed_extention} : ${fileswc}..."
cp --parents "${fastdlfile}" "${fastdldir}"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
@@ -255,7 +255,7 @@ fn_fastdl_gmod(){
else
fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}"
fi
done < <(find . -type f -iname ${allowed_extention})
done < <(find . -type f -iname "${allowed_extention}")
if [ ${fileswc} != 0 ]; then
fn_print_ok_eol_nl
fi
@@ -96,8 +96,8 @@ fn_monitor_check_lockfile(){
}

fn_monitor_check_update(){
# Monitor will not check if update is running.
if [ "$(ps -ef | grep "${selfname} update" | grep -v grep | wc -l)" != "0" ]; then
# Monitor will check if update is already running.
if [ "$(pgrep "${selfname} update" | wc -l)" != "0" ]; then
fn_print_error_nl "SteamCMD is currently checking for updates"
fn_script_log_error "SteamCMD is currently checking for updates"
core_exit.sh
@@ -11,4 +11,4 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
info_config.sh
exitbypass=1
command_stop.sh
command_start.sh
command_start.sh
@@ -35,7 +35,7 @@ fn_start_teamspeak3(){
if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then
install_eula.sh
fi
cd "${executabledir}"
cd "${executabledir}" || exit
if [ "${ts3serverpass}" == "1" ]; then
./ts3server_startscript.sh start serveradmin_password="${newpassword}" inifile="${servercfgfullpath}" > /dev/null 2>&1
else
@@ -86,7 +86,7 @@ fn_start_tmux(){

# Create lockfile
date > "${rootdir}/${lockselfname}"
cd "${executabledir}"
cd "${executabledir}" || exit
tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${servicename}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${servicename}-tmux-error.tmp"

# Create logfile.
@@ -154,7 +154,7 @@ fn_sleep_time
echo ""
echo "Fix"
echo "================================="
if [ ! $(grep "tty:" /etc/group|grep "$(whoami)") ]; then
if [ ! "$(grep "tty:" /etc/group|grep "$(whoami)")" ]; then
echo "$(whoami) is not part of the tty group."
fn_script_log_info "$(whoami) is not part of the tty group."
group=$(grep tty /etc/group)
@@ -10,4 +10,4 @@ functionfile="${FUNCNAME}"
fn_fetch_function
}

command_update_linuxgsm.sh
command_update_linuxgsm.sh
@@ -34,7 +34,7 @@ fn_clear_tmp(){
fn_print_error_eol_nl
fn_script_log_error "clearing LinuxGSM tmp directory"
fi
fi
fi
}

fn_dl_md5(){
@@ -260,4 +260,4 @@ curlpath=$(command -v curl 2>/dev/null)
if [ "$(basename "${curlpath}")" != "curl" ]; then
echo "[ FAIL ] Curl is not installed"
exit 1
fi
fi
@@ -10,4 +10,4 @@ fn_exit_trap(){
}

# trap to give an exit code.
trap fn_exit_trap INT
trap fn_exit_trap INT
@@ -11,4 +11,4 @@ fi

if [ ! -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]; then
ln -s "$HOME/Steam/steamapps/" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps"
fi
fi
@@ -14,4 +14,4 @@ if [ ! -d "${HOME}/.local/share/Arma 3" ]||[ ! -d "${HOME}/.local/share/Arma 3 -
fn_fix_msg_start
mkdir -p "${HOME}/.local/share/Arma 3 - Other Profiles"
fn_fix_msg_end
fi
fi
@@ -8,4 +8,4 @@ local commandname="FIX"
local commandaction="Fix"

# Fixes: MALLOC_CHECK_ needing to be set to 0.
export MALLOC_CHECK_=0
export MALLOC_CHECK_=0
@@ -30,4 +30,4 @@ exitbypass=1
command_start.sh
sleep 5
exitbypass=1
command_stop.sh
command_stop.sh
@@ -7,4 +7,4 @@
local commandname="FIX"
local commandaction="Fix"

export LD_LIBRARY_PATH="${serverfiles}/linux64:${serverfiles}:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="${serverfiles}/linux64:${serverfiles}:$LD_LIBRARY_PATH"
@@ -7,4 +7,4 @@
local commandname="FIX"
local commandaction="Fix"

export LD_LIBRARY_PATH="${serverfiles}"
export LD_LIBRARY_PATH="${serverfiles}"
@@ -11,4 +11,4 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
#Set Binary Executable
echo "chmod +x ${executabledir}/${executable}"
chmod +x "${executabledir}/${executable}"
fn_sleep_time
fn_sleep_time
@@ -30,4 +30,4 @@ exitbypass=1
command_start.sh
sleep 5
exitbypass=1
command_stop.sh
command_stop.sh
@@ -235,9 +235,9 @@ fi
if [ "$(command -v jq 2>/dev/null)" ]; then
if [ "${ip}" ]&&[ "${port}" ]; then
if [ "${steammaster}" == "true" ]; then
masterserver=$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)
masterserver="$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)"
if [ "${masterserver}" == "0" ]; then
masterserver=$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)
masterserver="$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)"
fi
if [ "${masterserver}" == "0" ]; then
displaymasterserver="false"

0 comments on commit 1d41bc6

Please sign in to comment.
You can’t perform that action at this time.