From 0bfbdbc01fe662114459fc7aa5a195d617b08e0c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 26 May 2017 21:30:46 +0100 Subject: [PATCH] Got rid of double returns --- CONTRIBUTING.md | 5 +---- lgsm/functions/alert_email.sh | 3 --- lgsm/functions/command_backup.sh | 1 - lgsm/functions/command_details.sh | 1 - lgsm/functions/command_dev_detect_deps.sh | 2 -- lgsm/functions/command_monitor.sh | 1 - lgsm/functions/command_postdetails.sh | 1 - lgsm/functions/command_ts3_server_pass.sh | 2 -- lgsm/functions/core_dl.sh | 2 -- lgsm/functions/core_functions.sh | 7 ------- lgsm/functions/core_getopt.sh | 1 - lgsm/functions/fix.sh | 1 - lgsm/functions/gsquery.py | 1 - lgsm/functions/info_distro.sh | 1 - lgsm/functions/mods_core.sh | 2 -- lgsm/functions/update_factorio.sh | 1 - lgsm/functions/update_minecraft.sh | 1 - lgsm/functions/update_mta.sh | 1 - lgsm/functions/update_mumble.sh | 1 - lgsm/functions/update_steamcmd.sh | 1 - lgsm/functions/update_ts3.sh | 1 - linuxgsm.sh | 1 - 22 files changed, 1 insertion(+), 37 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fbbbb0430..0da1e4963 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,7 +36,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-&-Conventions) - - - +[Syntax & Coding Conventions](https://github.com/GameServerManagers/LinuxGSM/wiki/Syntax-&-Conventions) \ No newline at end of file diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh index b017e0b63..ab6922d0f 100644 --- a/lgsm/functions/alert_email.sh +++ b/lgsm/functions/alert_email.sh @@ -16,7 +16,6 @@ fn_details_email(){ echo -e "${alertbody}" >> "${emaillog}" } - fn_details_os(){ # # Distro Details @@ -90,8 +89,6 @@ fn_details_disk(){ } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 } - - fn_details_gameserver(){ # # Quake Live Server Details diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index 7448308cf..b99215f4a 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/functions/command_backup.sh @@ -63,7 +63,6 @@ fn_backup_init(){ fi } - # Check if server is started and wether to stop it fn_backup_stop_server(){ check_status.sh diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 5be6c9cc7..4fc5a7094 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -380,7 +380,6 @@ fn_details_statusbottom(){ echo -e "" } - # Engine Specific details fn_details_ark(){ diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh index 5536f7bed..e292264ba 100644 --- a/lgsm/functions/command_dev_detect_deps.sh +++ b/lgsm/functions/command_dev_detect_deps.sh @@ -73,10 +73,8 @@ while read lib; do unknownlib=1 echo "${lib}" >> "${tmpdir}/.depdetect_unknown" fi - done < "${tmpdir}/.depdetect_readelf_uniq" - sort "${tmpdir}/.depdetect_centos_list" | uniq >> "${tmpdir}/.depdetect_centos_list_uniq" sort "${tmpdir}/.depdetect_ubuntu_list" | uniq >> "${tmpdir}/.depdetect_ubuntu_list_uniq" sort "${tmpdir}/.depdetect_debian_list" | uniq >> "${tmpdir}/.depdetect_debian_list_uniq" diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 0064ab439..cd12285cf 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -105,7 +105,6 @@ check.sh logs.sh info_config.sh - fn_monitor_check_lockfile fn_monitor_check_update fn_monitor_msg_checking diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh index e535e554c..414569381 100644 --- a/lgsm/functions/command_postdetails.sh +++ b/lgsm/functions/command_postdetails.sh @@ -107,7 +107,6 @@ if ! grep -q "^steamuser[= ]\"anonymous\"" "${tmpfile}" ; then sed -i -e 's/steamuser[= ]"[^"]*/steamuser "--stripped--/' "${tmpfile}" fi - if [ "${posttarget}" == "http://pastebin.com" ] ; then fn_print_dots "Posting details to pastbin.com for ${postexpire}" sleep 1 diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh index 964b93211..2e40691dd 100644 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -9,7 +9,6 @@ local commandname="TS3-CHANGE-PASS" local commandaction="ServerAdmin Password Change" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" - fn_serveradmin_password_prompt(){ fn_print_header echo "Press \"CTRL+b d\" to exit console." @@ -23,7 +22,6 @@ fn_serveradmin_password_prompt(){ read -p "Enter new password : " newpassword } - fn_serveradmin_password_set(){ fn_print_info_nl "Starting server with new password..." fn_script_log_info "Starting server with new password" diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 13e9d8951..46cab72b5 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -154,7 +154,6 @@ fn_fetch_file(){ fi } - # GitHub file download functions # Used to simplify downloading specific files from GitHub @@ -236,7 +235,6 @@ fn_update_function(){ fn_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } - # Defines curl path curl_paths_array=($(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl) for curlpath in "${curl_paths_array}" diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index b95ef9e66..31e8987e1 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -49,7 +49,6 @@ functionfile="${FUNCNAME}" fn_fetch_function } - # Commands command_console.sh(){ @@ -226,7 +225,6 @@ functionfile="${FUNCNAME}" fn_fetch_function } - # Compress compress_unreal2_maps.sh(){ @@ -273,7 +271,6 @@ functionfile="${FUNCNAME}" fn_fetch_function } - # Fix fix.sh(){ @@ -368,7 +365,6 @@ functionfile="${FUNCNAME}" fn_fetch_function } - # Alert alert.sh(){ @@ -393,7 +389,6 @@ functionfile="${FUNCNAME}" fn_fetch_function } - # Monitor monitor_gsquery.sh(){ @@ -401,7 +396,6 @@ functionfile="${FUNCNAME}" fn_fetch_function } - # Update command_update_functions.sh(){ @@ -454,7 +448,6 @@ functionfile="${FUNCNAME}" fn_fetch_function } - # ## Installer functions # diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 391b47665..470a4fb69 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -71,7 +71,6 @@ fi #Backup currentopt+=( "${cmd_backup[@]}" ) - # Exclude games without a console if [ "${gamename}" != "TeamSpeak 3" ]; then currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 250709cca..3f18a685b 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -36,7 +36,6 @@ fn_fix_msg_end(){ fi } - # Fixes that are run on start if [ "${function_selfname}" != "command_install.sh" ]; then if [ -n "${appid}" ]; then diff --git a/lgsm/functions/gsquery.py b/lgsm/functions/gsquery.py index 05d18f9fc..e1f5c3f77 100644 --- a/lgsm/functions/gsquery.py +++ b/lgsm/functions/gsquery.py @@ -76,7 +76,6 @@ class PythonGSQ: if not self.option.port: self.fatal_error('No port supplied.', 4) - if __name__ == '__main__': parser = optparse.OptionParser( usage='usage: python %prog [options]', diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index c8253f295..0c2c770a3 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -54,7 +54,6 @@ minutes=$(( uptime/60%60 )) hours=$(( uptime/60/60%24 )) days=$(( uptime/60/60/24 )) - ### Performance information ## Average server load diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index b5bf221fc..62d08ef1d 100644 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -16,8 +16,6 @@ extractdir="${modstmpdir}/extract" modsinstalledlist="installed-mods.txt" modsinstalledlistfullpath="${modsdir}/${modsinstalledlist}" - - ## Installation # Download management diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh index 3d0a73357..b39a4f86b 100644 --- a/lgsm/functions/update_factorio.sh +++ b/lgsm/functions/update_factorio.sh @@ -151,7 +151,6 @@ fn_update_factorio_compare(){ fi } - fn_update_factorio_arch if [ "${installer}" == "1" ]; then fn_update_factorio_availablebuild diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh index b28700fef..00fa96a08 100644 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/functions/update_minecraft.sh @@ -144,7 +144,6 @@ fn_update_compare(){ fi } - if [ "${installer}" == "1" ]; then fn_update_availablebuild fn_update_dl diff --git a/lgsm/functions/update_mta.sh b/lgsm/functions/update_mta.sh index 72aaf65ec..2afc94abd 100644 --- a/lgsm/functions/update_mta.sh +++ b/lgsm/functions/update_mta.sh @@ -139,7 +139,6 @@ fn_update_mta_compare(){ fi } - if [ "${installer}" == "1" ]; then fn_mta_get_availablebuild fn_update_mta_dl diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index b16ea69c4..9f2ee5629 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -151,7 +151,6 @@ fn_update_mumble_compare(){ fi } - fn_update_mumble_arch if [ "${installer}" == "1" ]; then fn_update_mumble_availablebuild diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index 1b09f3295..ff9cd8672 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -229,7 +229,6 @@ fn_update_steamcmd_check(){ fi } - if [ "${engine}" == "goldsource" ]||[ "${forceupdate}" == "1" ]; then # Goldsource servers bypass checks as fn_update_steamcmd_check does not work for appid 90 servers. # forceupdate bypasses checks diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index 982d7aecb..7ecd3d202 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -178,7 +178,6 @@ fn_update_ts3_compare(){ fi } - fn_update_ts3_arch if [ "${installer}" == "1" ]; then fn_update_ts3_availablebuild diff --git a/linuxgsm.sh b/linuxgsm.sh index 01da46b56..0d52bec24 100644 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -34,7 +34,6 @@ configdir="${lgsmdir}/config-lgsm" configdirserver="${configdir}/${servername}" configdirdefault="${lgsmdir}/config-default" - ## GitHub Branch Select # Allows for the use of different function files # from a different repo and/or branch.