Skip to content

Commit d5a67c4

Browse files
committed
remove code no longer needed in ul
1 parent 1e14ff5 commit d5a67c4

File tree

2 files changed

+18
-32
lines changed

2 files changed

+18
-32
lines changed

lgsm/modules/command_update_linuxgsm.sh

+3-17
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,10 @@ info_distro.sh
1616
fn_print_dots ""
1717
fn_script_log_info "Updating LinuxGSM"
1818

19+
fn_repo_selector
1920
fn_print_dots "Selecting repo"
20-
fn_script_log_info "Selecting repo"
21-
# Select remotereponame
22-
curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null
23-
if [ $? != "0" ]; then
24-
curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null
25-
if [ $? != "0" ]; then
26-
fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories"
27-
fn_script_log_fatal "Selecting repo: Unable to to access GitHub or Bitbucket repositories"
28-
core_exit.sh
29-
else
30-
remotereponame="Bitbucket"
31-
fn_print_ok_nl "Selecting repo: ${remotereponame}"
32-
fi
33-
else
34-
remotereponame="GitHub"
35-
fn_print_ok_nl "Selecting repo: ${remotereponame}"
36-
fi
21+
fn_print_ok_nl "Selecting repo: ${remotereponame}"
22+
fn_script_log_pass "Selecting repo: ${remotereponame}"
3723

3824
# Check linuxsm.sh
3925
echo -en "checking ${remotereponame} linuxgsm.sh...\c"

linuxgsm.sh

+15-15
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# Debugging
1717
if [ -f ".dev-debug" ]; then
18-
exec 5>dev-debug.log
18+
exec 5> dev-debug.log
1919
BASH_XTRACEFD="5"
2020
set -x
2121
fi
@@ -52,17 +52,17 @@ userinput2="${2}"
5252
[ -n "${LGSM_GITHUBBRANCH}" ] && githubbranch="${LGSM_GITHUBBRANCH}" || githubbranch="master"
5353

5454
# Check that curl is installed before doing anything
55-
if [ ! "$(command -v curl 2>/dev/null)" ]; then
55+
if [ ! "$(command -v curl 2> /dev/null)" ]; then
5656
echo -e "[ FAIL ] Curl is not installed"
5757
exit 1
5858
fi
5959

6060
fn_repo_selector() {
6161
# Check if GitHub is accessible if not fail over to Bitbucket.
62-
repocheck=$(curl -s -o /dev/null -w "%{http_code}" "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/linuxgsm.sh" 2>/dev/null)
62+
repocheck=$(curl -s -o /dev/null -w "%{http_code}" "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/linuxgsm.sh" 2> /dev/null)
6363
if [ "${repocheck}" != "200" ]; then
6464
echo -e "Selecting repo: GitHub is not accessable. Selecting Bitbucket"
65-
repocheck=$(curl -s -o /dev/null -w "%{http_code}" "https://bitbucket.org/GameServerManagers/LinuxGSM/master/linuxgsm.sh" 2>/dev/null)
65+
repocheck=$(curl -s -o /dev/null -w "%{http_code}" "https://bitbucket.org/GameServerManagers/LinuxGSM/raw/master/linuxgsm.sh" 2> /dev/null)
6666
if [ "${repocheck}" != "200" ]; then
6767
echo -e "Selecting repo: Unable to to access GitHub or Bitbucket repositories"
6868
exit 1
@@ -75,9 +75,9 @@ fn_repo_selector() {
7575

7676
# Check that git branch exists.
7777
if [ "${remotereponame}" == "GitHub" ]; then
78-
branchexistscheck=$(curl -s -o /dev/null -w "%{http_code}" "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 2>/dev/null)
78+
branchexistscheck=$(curl -s -o /dev/null -w "%{http_code}" "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 2> /dev/null)
7979
else
80-
branchexistscheck=$(curl -s -o /dev/null -w "%{http_code}" "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 2>/dev/null)
80+
branchexistscheck=$(curl -s -o /dev/null -w "%{http_code}" "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 2> /dev/null)
8181
fi
8282

8383
if [ "${branchexistscheck}" != "200" ]; then
@@ -244,7 +244,7 @@ fn_install_menu_bash() {
244244
while read -r line || [[ -n "${line}" ]]; do
245245
var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}')
246246
menu_options+=("${var}")
247-
done <"${options}"
247+
done < "${options}"
248248
menu_options+=("Cancel")
249249
select option in "${menu_options[@]}"; do
250250
if [ "${option}" ] && [ "${option}" != "Cancel" ]; then
@@ -270,7 +270,7 @@ fn_install_menu_whiptail() {
270270
key=$(echo -e "${line}" | awk -F "," '{print $3}')
271271
val=$(echo -e "${line}" | awk -F "," '{print $2}')
272272
menu_options+=("${val//\"/}" "${key//\"/}")
273-
done <"${options}"
273+
done < "${options}"
274274
OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3)
275275
if [ $? == 0 ]; then
276276
eval "$resultvar=\"${OPTION}\""
@@ -294,12 +294,12 @@ fn_install_menu() {
294294
fi
295295
done
296296
case "$(basename "${menucmd}")" in
297-
whiptail | dialog)
298-
fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30
299-
;;
300-
*)
301-
fn_install_menu_bash selection "${title}" "${caption}" "${options}"
302-
;;
297+
whiptail | dialog)
298+
fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30
299+
;;
300+
*)
301+
fn_install_menu_bash selection "${title}" "${caption}" "${options}"
302+
;;
303303
esac
304304
eval "$resultvar=\"${selection}\""
305305
}
@@ -382,7 +382,7 @@ if [ "${shortname}" == "core" ]; then
382382
} | column -s $'\t' -t | more
383383
exit
384384
elif [ "${userinput}" == "install" ] || [ "${userinput}" == "i" ]; then
385-
tail -n +1 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' >"${serverlistmenu}"
385+
tail -n +1 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}"
386386
fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}"
387387
userinput="${result}"
388388
fn_server_info

0 commit comments

Comments
 (0)