Browse Source

Update fctrserver

pull/1133/head
Kristian Polso 9 years ago
parent
commit
9fccb19619
  1. 76
      Factorio/fctrserver

76
Factorio/fctrserver

@ -5,9 +5,9 @@
# Contributor: Kristian Polso # Contributor: Kristian Polso
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
if [ -f ".dev-debug" ]; then if [ -f ".dev-debug" ]; then
exec 5>dev-debug.log exec 5>dev-debug.log
BASH_XTRACEFD="5" BASH_XTRACEFD="5"
set -x set -x
fi fi
version="171016" version="171016"
@ -27,11 +27,15 @@ email="[email protected]"
pushbulletalert="off" pushbulletalert="off"
pushbullettoken="accesstoken" pushbullettoken="accesstoken"
# Start Variables # Server settings
# More settings available after install in serverfiles/data/server-settings.json
updateonstart="off" updateonstart="off"
port="34197"
rconport="34198"
rconpassword="factorio"
fn_parms(){ fn_parms(){
parms="-fg -ini ${servercfgfullpath}" parms="--start-server ${filesdir}/save1.zip --server-settings ${servercfgfullpath} --port ${port} --rcon-port ${rconport} --rcon-password ${rconpassword}"
} }
#### Advanced Variables #### #### Advanced Variables ####
@ -91,36 +95,36 @@ filename="${github_file_url_name}"
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
# If the file is missing, then download # If the file is missing, then download
if [ ! -f "${filedir}/${filename}" ]; then if [ ! -f "${filedir}/${filename}" ]; then
if [ ! -d "${filedir}" ]; then if [ ! -d "${filedir}" ]; then
mkdir -p "${filedir}" mkdir -p "${filedir}"
fi fi
echo -e " fetching ${filename}...\c" echo -e " fetching ${filename}...\c"
# Check curl exists and use available path # Check curl exists and use available path
curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
for curlcmd in ${curlpaths} for curlcmd in ${curlpaths}
do do
if [ -x "${curlcmd}" ]; then if [ -x "${curlcmd}" ]; then
break break
fi fi
done done
# If curl exists download file # If curl exists download file
if [ "$(basename ${curlcmd})" == "curl" ]; then if [ "$(basename ${curlcmd})" == "curl" ]; then
curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo -e "\e[0;31mFAIL\e[0m\n" echo -e "\e[0;31mFAIL\e[0m\n"
echo "${curlfetch}" echo "${curlfetch}"
echo -e "${githuburl}\n" echo -e "${githuburl}\n"
exit 1 exit 1
else else
echo -e "\e[0;32mOK\e[0m" echo -e "\e[0;32mOK\e[0m"
fi fi
else else
echo -e "\e[0;31mFAIL\e[0m\n" echo -e "\e[0;31mFAIL\e[0m\n"
echo "Curl is not installed!" echo "Curl is not installed!"
echo -e "" echo -e ""
exit 1 exit 1
fi fi
chmod +x "${filedir}/${filename}" chmod +x "${filedir}/${filename}"
fi fi
source "${filedir}/${filename}" source "${filedir}/${filename}"
} }
@ -141,4 +145,4 @@ core_dl.sh
core_functions.sh core_functions.sh
getopt=$1 getopt=$1
core_getopt.sh core_getopt.sh
Loading…
Cancel
Save