File tree Expand file tree Collapse file tree 13 files changed +28
-31
lines changed Expand file tree Collapse file tree 13 files changed +28
-31
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
11
11
fn_firstcommand_reset
12
12
13
13
if [ -f " ${rootdir} /.dev-debug" ]; then
14
- rm " ${rootdir:? } /.dev-debug"
14
+ rm -f " ${rootdir:? } /.dev-debug"
15
15
fn_print_ok_nl " Disabled dev-debug"
16
16
fn_script_log_info " Disabled dev-debug"
17
17
else
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ fn_clear_old_fastdl() {
68
68
# Clearing old FastDL.
69
69
if [ -d " ${fastdldir} " ]; then
70
70
echo -en " clearing existing FastDL directory ${fastdldir} ..."
71
- rm -fR " ${fastdldir:? } "
71
+ rm -rf " ${fastdldir:? } "
72
72
exitcode=$?
73
73
if [ " ${exitcode} " != 0 ]; then
74
74
fn_print_fail_eol_nl
@@ -277,7 +277,7 @@ fn_fastdl_gmod() {
277
277
# Clear addons directory in fastdl.
278
278
echo -en " clearing addons dir from fastdl dir..."
279
279
fn_sleep_time
280
- rm -fR " ${fastdldir:? } /addons"
280
+ rm -rf " ${fastdldir:? } /addons"
281
281
exitcode=$?
282
282
if [ " ${exitcode} " != 0 ]; then
283
283
fn_print_fail_eol_nl
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ fn_start_tmux() {
171
171
fn_print_ok " ${servername} "
172
172
fn_script_log_pass " Started ${servername} "
173
173
fi
174
- rm " ${lgsmlogdir:? } /.${selfname} -tmux-error.tmp" 2> /dev/null
174
+ rm -f " ${lgsmlogdir:? } /.${selfname} -tmux-error.tmp" 2> /dev/null
175
175
echo -en " \n"
176
176
}
177
177
Original file line number Diff line number Diff line change @@ -374,7 +374,7 @@ fn_fetch_file() {
374
374
# Download will fail if downloads a html file.
375
375
if [ -f " ${local_filedir} /${local_filename} " ]; then
376
376
if [ -n " $( head " ${local_filedir} /${local_filename} " | grep " DOCTYPE" ) " ]; then
377
- rm " ${local_filedir:? } /${local_filename:? } "
377
+ rm -f " ${local_filedir:? } /${local_filename:? } "
378
378
local exitcode=2
379
379
fi
380
380
fi
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ fn_check_steamcmd_dir() {
73
73
# Symbolic links to Steam installation directory.
74
74
if [ ! -L " ${HOME} /.steam/root" ]; then
75
75
if [ -d " ${HOME} /.steam/root" ]; then
76
- rm " ${HOME} /.steam/root"
76
+ rm -f " ${HOME:? } /.steam/root"
77
77
fi
78
78
ln -s " ${XDG_DATA_HOME:= " ${HOME} /.local/share" } /Steam" " ${HOME} /.steam/root"
79
79
fi
Original file line number Diff line number Diff line change @@ -2561,27 +2561,24 @@ elif [ "${engine}" == "unreal2" ]; then
2561
2561
fi
2562
2562
2563
2563
# External IP address
2564
- if [ -z " ${extip} " ]; then
2564
+ # Cache external IP address for 24 hours
2565
+ if [ -f " ${tmpdir} /extip.txt" ]; then
2566
+ if [ " $( find " ${tmpdir} /extip.txt" -mmin +1440) " ]; then
2567
+ rm -f " ${tmpdir:? } /extip.txt"
2568
+ fi
2569
+ fi
2570
+
2571
+ if [ ! -f " ${tmpdir} /extip.txt" ]; then
2565
2572
extip=" $( curl --connect-timeout 10 -s https://api.ipify.org 2> /dev/null) "
2566
2573
exitcode=$?
2567
- # Should ifconfig.co return an error will use last known IP.
2568
- if [ ${exitcode} -eq 0 ]; then
2569
- if [[ " ${extip} " != * " DOCTYPE" * ]]; then
2570
- echo -e " ${extip} " > " ${tmpdir} /extip.txt"
2571
- else
2572
- if [ -f " ${tmpdir} /extip.txt" ]; then
2573
- extip=" $( cat " ${tmpdir} /extip.txt" ) "
2574
- else
2575
- fn_print_error_nl " Unable to get external IP"
2576
- fi
2577
- fi
2574
+ # if curl passes add extip to externalip.txt
2575
+ if [ " ${exitcode} " == " 0" ]; then
2576
+ echo " ${extip} " > " ${tmpdir} /extip.txt"
2578
2577
else
2579
- if [ -f " ${tmpdir} /extip.txt" ]; then
2580
- extip=" $( cat " ${tmpdir} /extip.txt" ) "
2581
- else
2582
- fn_print_error_nl " Unable to get external IP"
2583
- fi
2578
+ echo " Unable to get external IP address"
2584
2579
fi
2580
+ else
2581
+ extip=" $( cat " ${tmpdir} /extip.txt" ) "
2585
2582
fi
2586
2583
2587
2584
# Alert IP address
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ info_distro.sh
12
12
13
13
# remove uuid that was used in v20.2.0 and below
14
14
if [ -f " ${datadir} /uuid.txt" ]; then
15
- rm " ${datadir:? } /uuid.txt"
15
+ rm -f " ${datadir:? } /uuid.txt"
16
16
fi
17
17
18
18
# generate uuid's
Original file line number Diff line number Diff line change @@ -440,7 +440,7 @@ fn_mods_create_tmp_dir() {
440
440
fn_mods_clear_tmp_dir () {
441
441
if [ -d " ${modstmpdir} " ]; then
442
442
echo -en " clearing mod download directory ${modstmpdir} ..."
443
- rm -fr " ${modstmpdir:? } "
443
+ rm -rf " ${modstmpdir:? } "
444
444
exitcode=$?
445
445
if [ " ${exitcode} " != 0 ]; then
446
446
fn_print_fail_eol_nl
@@ -742,7 +742,7 @@ fn_mod_remove_amxmodx_file() {
742
742
743
743
# if file is empty, remove it.
744
744
if [ -f " ${modinstalldir} /addons/metamod/plugins.ini" ]; then
745
- rm " ${modinstalldir} /addons/metamod/plugins.ini"
745
+ rm -f " ${modinstalldir} /addons/metamod/plugins.ini"
746
746
fn_script_log_pass " file removed ${modinstalldir} /addons/metamod/plugins.ini because it was empty"
747
747
fi
748
748
fi
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ fn_bootstrap_fetch_file() {
113
113
# Download will fail if downloads a html file.
114
114
if [ -f " ${local_filedir} /${local_filename} " ]; then
115
115
if [ -n " $( head " ${local_filedir} /${local_filename} " | grep " DOCTYPE" ) " ]; then
116
- rm " ${local_filedir:? } /${local_filename:? } "
116
+ rm -f " ${local_filedir:? } /${local_filename:? } "
117
117
local exitcode=2
118
118
fi
119
119
fi
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ fn_bootstrap_fetch_file() {
112
112
# Download will fail if downloads a html file.
113
113
if [ -f " ${local_filedir} /${local_filename} " ]; then
114
114
if [ -n " $( head " ${local_filedir} /${local_filename} " | grep " DOCTYPE" ) " ]; then
115
- rm " ${local_filedir:? } /${local_filename:? } "
115
+ rm -f " ${local_filedir:? } /${local_filename:? } "
116
116
local exitcode=2
117
117
fi
118
118
fi
You can’t perform that action at this time.
0 commit comments