-
-
Notifications
You must be signed in to change notification settings - Fork 784
/
command_validate.sh
57 lines (51 loc) · 1.76 KB
/
command_validate.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# LinuxGSM command_validate.sh function
# Author: Daniel Gibbs
# Website: https://linuxgsm.com
# Description: Runs a server validation.
local commandname="VALIDATE"
local commandaction="Validate"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")
fn_validation(){
fn_print_info "Validating files: SteamCMD"
echo -e ""
echo -e "* Validating may overwrite some customised files."
echo -e "* https://docs.linuxgsm.com/commands/validate"
fn_script_log_info "Validating files: SteamCMD"
sleep 3
if [ -d "${steamcmddir}" ]; then
cd "${steamcmddir}" || exit
fi
# Detects if unbuffer command is available for 32 bit distributions only.
info_distro.sh
if [ "$(command -v stdbuf)" ]&&[ "${arch}" != "x86_64" ]; then
unbuffer="stdbuf -i0 -o0 -e0"
fi
if [ "${appid}" == "90" ]; then
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" +app_update "${appid}" -beta "${branch}" validate +quit | tee -a "${lgsmlog}"
else
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" validate +quit | tee -a "${lgsmlog}"
fi
if [ $? != 0 ]; then
fn_print_fail_nl "Validating files: SteamCMD"
fn_script_log_fatal "Validating files: SteamCMD: FAIL"
else
fn_print_ok_nl "Validating files: SteamCMD"
fn_script_log_pass "Validating files: SteamCMD: OK"
fi
fix.sh
}
fn_print_dots "Validating files:"
fn_print_dots "Validating files: SteamCMD"
check.sh
check_status.sh
if [ "${status}" != "0" ]; then
exitbypass=1
command_stop.sh
fn_validation "${appid}"
exitbypass=1
command_start.sh
else
fn_validation
fi
core_exit.sh