gameservergame-servergame-servershacktoberfestdedicated-game-serversgamelinuxgsmserverbashgaminglinuxmultiplayer-game-servershell
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.4 KiB
53 lines
1.4 KiB
#!/bin/bash
|
|
# LGSM command_update_functions.sh function
|
|
# Author: Daniel Gibbs
|
|
# Website: https://gameservermanagers.com
|
|
lgsm_version="210516"
|
|
|
|
# Description: Deletes the functions dir to allow re-downloading of functions from GitHub.
|
|
|
|
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
|
|
check.sh
|
|
fn_print_dots "Updating functions"
|
|
fn_script_log_info "Updating functions"
|
|
sleep 1
|
|
echo -ne "\n"
|
|
|
|
# Removed legecy functions dir
|
|
if [ -n "${rootdir}" ]; then
|
|
if [ -d "${rootdir}/functions/" ]; then
|
|
rm -rfv "${rootdir}/functions/"
|
|
exitcode=$?
|
|
fi
|
|
fi
|
|
|
|
if [ -n "${functionsdir}" ]; then
|
|
if [ -d "${functionsdir}" ]; then
|
|
|
|
cd "${functionsdir}"
|
|
for functionfile in *
|
|
do
|
|
#functionfile=core_exit.sh
|
|
echo "FUNCTIONFILE: ${functionfile}"
|
|
function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl -s https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}))
|
|
if [ "${function_file_diff}" != "" ]; then
|
|
echo "rm -rfv ${functionsdir}/${functionfile}"
|
|
rm -rfv "${functionsdir}/${functionfile}"
|
|
fn_update_function
|
|
core_exit.sh
|
|
fi
|
|
done
|
|
fi
|
|
fi
|
|
|
|
if [ "${exitcode}" == "0" ]; then
|
|
fn_print_ok "Updating functions"
|
|
fn_script_log_pass "Success! Updating functions"
|
|
exitcode=0
|
|
else
|
|
fn_print_fail "Updating functions"
|
|
fn_script_log_fatal "Failure! Updating functions"
|
|
exitcode=1
|
|
fi
|
|
echo -ne "\n"
|
|
core_exit.sh
|